Simplify testing code

This is part of a process to reduce the complexity of the testing code to aid maintainability. The approach to testing is the standard test-driven test paradigm used in the standard library.