Improve protocol serialization

* Implement immutable, type-safe, and reflectionless protocol classes.
* Throw IllegalArgumentException consistently in constructor (or as low as
  possible) for invalid fields on protocol messages.