Adding simple tests for the database to ensure opening, closing and writing/reading works.
Saving/restoring from a database now works.