Renamed db to database and added some configuration options