Implement MQTT protocol

For a sample application see [here](https://github.com/tu500/ethersex/tree/autoc4).
The absence of a length check is wanted and mentioned in the function's comment.
Fixed the rest.