Add sql table definitions.
Basic implementation of database initialization.
Fix bugs and cleaner debug output.
Initialize database only if necessary.
Outsource DBWork into a separate header file.
Merge branch 'db-init' into develop