Serialise and deserialise opaque IDs on LookupRefs