separate protocol validation checks out
added WriteMessage wrapper; return bytes read from ReadMessage
minor updates