DATAGRAPH-466 fix

Addition of unit test to recreate the issue, then change CypherQuery.toQueryString() from using an ArrayList of match clauses to use a TreeSet to remove duplicates and retain ordering.