Towards a Thermodynamic Theory for Ecological Systems