Add database initialization functions.
Moved database and table names out to consts.