add test coverage against query methods
Fix broken query#fakeEvent method
Refactor query#on