Add an extra factory function for 'SetOfMergedPaths' that doesn't use a filter.
Minor refactoring - name some previously anonymous code blocks in the implementation of 'SetOfMergedPaths' for clarity.