Export Message type
Add tests for JSON decoding