Moves database connection method to Database class

 - all db connections made using the Database class
 - fixes error where user was not saved to db when signing in