Expose Handler type synonym
Throw exception if query takes too long
Fix warnings
Run each handler in separate thread.

This is needed because handler can call query too. The minimal example:

* listener received KQuery(1);
* listener dispatch corresponding handler;
* handler send KQuery(2);
* handler blocked waiting for response;
* listener is unable to receive KQuery(2) because it is blocked on
  handler.

So we should run each handler in separated thread otherwise dead lock
can happen.