some clean up support for tests, plus a class to write clusters as labeled classes