Some reworking of the tests and reposdir to make it easier to test.