Refactored and tested

This change refactors and fully tests the code in the Test Support
framework.
Merge branch 'test-support-framework'