Add tests for getDirs
Slight refactor to make testing easier; test the zero case for listAvailableCredentals