Changed a bunch of DB stuff, possibly some changes to templates.
Moved from db to ndb. Yay.