Implement message reader.

Currently the reader skips control frames.
Implement message writer.