Add facility to do filtering by related node properties.

This is pretty horrible ATM and would probably be better implemented
via Cypher or by using the Gremlin scriptEngine. Instead it starts
with a hacky way of describing paths and, via torturous means,
constructs a Gremlin path in Java. Aside from it generally being a
dumb approach, it is also quite ineffecient in the way it builds a
new Gremlin path for every node. TODO: Fix.