Integrate Energy functions

Add energy support to block and utilize, also minor code cleanup
elsewhere.