Improve unit testing framework

This PR is for @ChinggizKhan to review.  He will issue a PR to `2.x.x` when the testing work is completed.

The commits should be fairly self-explanatory, but I'll leave some comments on the diff to explain my reasoning.  I'm not a Compass expert, especially when it comes to their compiler, but I think that these changes capture the improvements you were looking to make to the code.