Moved the test code out of the primary visualization code.