Changed db to postgres, made some heroku compatibility changes.