Diversifying selection and host adaptation in two endosymbiont genomes