Foundations of Ecological Resilience