Added message serialization (wip).