Cleanup and refactor of test code.  Move common test utils to separate
class to be used with multiple unit tests.