Fixed things in database.h and added .cpp files