Fix database configuration

Signed-off-by: Igor Popov <igor@igorpopov.io>
Use objects and MVC

Signed-off-by: Igor Popov <igor@igorpopov.io>
Work in progress

Signed-off-by: Igor Popov <igor@igorpopov.io>