Implement message writer.

I do, but it's called something that doesn't make sense for here (`MAX_CONTROL_PAYLOAD`). I can name it something that will make sense for both.