Moved DB logic to DatabaseManager (for pooling)

* Also, added privacy statement and terms of service.
* Numerous tweaks to different pages.