update preferences when erasing a DB
Add tests for databaseWasInitialized