Gravitational energy

Restructured core model code, with some methods for calculation of energy inputs for parameterized convection.