Writing the migration data for sqlite3.
Redoing DB stuff.
Saner architecture this time around...
Needs testing, but I think the database functions are good.