added clause sorting to JSON query so that costlier operations would preferrably be done on small subsets of the database
added partial T-tree support for the JSON queries (initially only key index is supported)