Updated function for mongoose

Updated 'databaseAlreadySetUp()' to make it work with mongoose, also
fixed an issue in 'haveConnection()'. Started updating 'initDatabase()',
no longer fails...