Moved some of the test harness code from Rakefile to test/test_helper.