Make query commands asynchronous

- change filters to be a generator
- add callbacks in handler to use generator