Added cluWaitOnAnyEvent, overhauled query routines and added query sample