fix incorrect javadoc
fix bug in CodecBase

decode() must return null if any of the data in the buffer has been
consumed and state changed. Otherwise decode will be called again with
the same buffer contents, but with a changed state. This caused the
interop to break.

The assumption is now that if inputOutput returns non-null, then data
has been consumed and state has changed. Thus we return null and
let the ReplayingDecoder call decode() again with the potentially
remaining data instead of looping over it ourselves.

This feels quite fragile. There would seem to be some opportunity for
simplification here.
finish handshake before propagating connected evt

Ensure that the handshake is completed before propagating the connected
event upstream. Otherwise handlers upstream might be confused by
handshake traffic.