Microhabitats Shape Bacterial Community Composition, Ecosystem Function, And Genome Traits