Added database tests. Definitely need more test cases.
Merge pull request #65 from liubolightning/staging

Added database tests. Definitely need more test cases.