Evolutionary Origins of Genomic Repertoires in Bacteria