Refactored the code
- messages keeps a dirty flag to indicate if it's changed. If message is
  clean then encoding is a direct copy of the byte slice, rather than
  going through the encoding process.
- some updates to messages are done directly to the buffer (thus keeping
  it clean, i.e., dirty flag not set).
- QoS 1 and 2 messages are copied into ackqueue while waiting so the
  incoming/outgoing buffer can keep moving along (major issue in the
  last commit)
- Performance is slightly increased (~5-10%) overall