Added some dockblocks, refactored tests