Fixes bad usage of gremlin and returns to Neo4J graph backend.
Avoids duplicate node in query and target graph, leaving it only in the target graph, as other members of the query might benefit from it.
Avoids duplicated nodes between query and target list in the final output. This is just a safety measure, as this should be handled earlier on.