fix bugs from last commit; clears old code; more

* Fixes lots of bugs introduced in the last commit, which was an
untested commit.
* database no longer uses DBController