Implemented context object for base classes
refactored test cases
Fixed a few crude bugs (hopefully)