added database class and some other tests