Merge pull request #30 from devenbhooshan/master

Compact 2 database calls into 1.
Fix date selection UI. Closes #24
create database config file only if connected to db