Initial set of energy unit tests and corresponding improvements.