Added database tests. Definitely need more test cases.