Add serialisation methods #2719