Core code for new energy framework. Still to do FluidNetwork and GasNetwork.