Make dequeueN tail recursive, and comment out output from KNNQuery.
Put logging back into KNNQuery at the trace level, and make the same change to QueryPlanners.