Split database

Preliminary PR for splitting the database / models / sessions in two. Measure models are assigned to an 'archival' db, all other models are assigned to a 'volatile' db. If you can come up with better names for these dbs, feel free to suggest them.

All tests pass but I suspect I missed some things and/or made some mistakes / duplicated too much code in some places; it was pretty mechanical work and I'm happy to spend more time tidying it up to meet any suggestions.