Finished unit tests for DAO classes and did some minor refactoring.