Explicitly pass collections enumeration to method, in preparation
for use in other contexts.
Add ability to get collections belonging to a repository, including
some refactoring to simplify this.