Restored DDK.tree.sortQuery to server JavaScript.