box up functions so they can be tested without fiddling with global state
box up functions so they can be tested without fiddling with global state

emoncms/MyHomeEnergyPlanner,emoncms/MyHomeEnergyPlanner,emoncms/MyHomeEnergyPlanner,emoncms/MyHomeEnergyPlanner