Add database unit tests

This has a few simple unit tests for the database layer. It is meant to be run
with nose.
Fix name typo in comment strings