I've been continuing on the code cleanup and database, running face first into Django's dreaded ManyToMany. This bridges into a related problem of having a binary sqlite3 database in the code repository instead of a proper testing framework where temporary databases are created by the testing tool.
Work is available in PR but not ready for merging yet.