Added Total EP tracking.

* Refactored all code to be aware of TEP.
* Modified UI to show TEP in the table.
  * Changed UI to inherit from ButtonFrameTemplate instead of being manually constructed.
* Localed some (unintentional?) globals.