Fix db/index.coffee
Add db to app and assign app to global
Move router assignment below global declaration