fixed quite a few bugs, need to work on multi-queries, and event emitter inheritance does not function properly