Reorder home in app to use short-circuiting

Also tidy imports
Make schema easier to edit, add table-dropping
Add user registration
Mostly fix the database. A lot of refactoring.
Resolve many small bugs with the database.

Refactoring continues >_>