Ecological and evolutionary drivers of microbial community structure in termite guts