Clean up handshake message building.
Implement parsing of wire messages using io-streams.