Added and tested database class