Refactored user API code so that it doesn't depend on app.js
Refactored auth API modules not not be dependant on the app object
Refactored database connection initialisation into a seperate module