some general cleanups to the test suite and some tweaks

These clean up the test suite and some minor implementation
details in preparation for adding some additional callbacks.  The
additional callbacks will be added in the following commits.