Add thermodynamic potentials

Not ready to be merged. Opening for comments/suggestions.
I know, was about to push :( ... sorry!