Better DB interaction

Added a database class and added some example functions in the users
class.