Refactor some test harnessing