Start using mongoose for database management

Mongoose makes it much easier to manage the database. Migrated the
locomotives to use it.
Forgot to include the database config file

Added db.js