reworked the database class to work more with objects instead of regular
string based queries