Since a transport (and a streamlogger) does not implement io.ByteReader
xml.Decoder wraps it using `bufio.NewReader(transport)` so it can easily read
bytes one at a time. This has the unfortuante effect of resulting in a panic if
we try to parse a stanza that is larger than the default buffer size of 4096
bytes.
To fix this we wrap the transport using `bufio.NewReaderSize()` with a much
larger buffer size.
Websocket need to have a Reader running at all times in order to
allow Ping to work (because a Reader is the only thing that will
correctly handle control frames). To faciliate this a go function
is introduced that will always read from the websocket until it
is cancelled. Read data is passed to the transport via a channel.
XMPP and WebSocket transports require different open and close stanzas. To
handle this the responsibility handling those and creating the XML decoder is
moved to the Transport.
This makes it possible to use a factory function to create a transport of the right type and not having to repeat the address when calling Transport.Connect()