Rewrote database access classes. Added tests for posts.