Refactored out QueryHandler

Also some notes about complete pie-in-sky awesome ideas