Added support for GraphQuery
Reordered some code due to what appears to be an underlying titan bug