Generalizing DB connection configuration. Fixes #5