Improve Energy (energy  factory + energy classes)

Improvements:
1) Create a class for energies
2) Energy interface
3) Subclasses for each energy function
4) Create Factory method for instantiating energy functions