Connect to database before creating tables

- fix related to issue #38
- when configuration is done we should connect to database, defined by
  DATABASE variable, before starting creating tables. Otherwise we just
  connect to database.