Evolutionary histories of legume genomes and mechanisms of genome remodeling