Made message more c-struct like.

* Serialize was turned into a global function.