Evolutionary Consequences of Metabolic Competition and Cooperation in Microbial Communities