Fixes for Prod build

* Added long LICENSE
* Removed debugging statements
* Switch to SqlAlchemy calls for queries where appropriate
* Removed double version bump from main template (bad merge)
* Add local counter funcs.