Add a general database connection manager class

Update Registration and Login by using the general database connection manager