Made the PathRep collector more easily extensible.

In case there are any javascript lovers out there looking for
some code.

Also created a little distance from some slightly hardcoded ideas
about what makes a path.