Add GEnergy unit tests.

Following the recent bug discovery in the operator-= I added a bunch of unit tests to make sure that the GEnergy class is indeed doing what it is expected to do.