From Populations to Ecosystems: Theoretical Foundations for a New Ecological Synthesis