Small tweaks

* moved the DB config into its own library
* removed a double call to Sinatra
* small code cleanups