Speed up xPx and xPO queries

Vertices and edges are search for by properties using
Graph#get{Vertices,Edges}(key, value) and Graph#query methods.