Fixed jslint errors and added event emitters to query object