Implementation of splash.Obj.serialize