Refactor and test database

Refactor SQLiteDatabase and start adding a full test suite. Covers
SQLiteDatabase, TableDefinition, Table, and ColumnDefinition. Added alerts
to Log.