A raft of changes, mostly breaking stuff. Also a a start on the database.