Add test for repofile with a subdir.
Tidy up unit tests using folding.