A framework for understanding collective microbiome metabolism