Implement to_msgpack