Encode/decode net messages (#36)