Use local settings for database connection

Replaces #80.
Please review