This makes sending IQ more idiomatic Go, but more importantly it solves
a problem with contexts that were not being cancelled correctly with
the previous API.
As a side-effect of this change `Route.route` must now be invoked in a
go-routine to prevent deadlocks. This also allows for stanzas to be processed
in parallel, which can result in a nice performance win.
Simplify the API in several ways:
- provide the context to the IQ result handler, making it possible to pass in
extra context and handle timeouts within the handler.
- pass the stanza in as an IQ type, removing the need to always type-cast it
in the handler
- remove Router.HandleIqResult and Router.HandleFuncIqResult. Since the router
is private to Client nobody would ever use these, and they do not really make
things simpler anyway.
- Using the router, the dispatch is not done anymore by receiving from
receive channel, but by registering callback functions in routers,
with matchers.
- Make IQPayload a real interface to make it easier to match namespaces.
- The StreamManager Run command is now blocking, waiting for StreamManager
to terminate.