update to login, new databsae class

log in is abit more functional, an instance of database connects to the
database and run all the updates to the database (incomplete)