Move some test code that should be in the test harness