def clear_cached_instances
        @instances = []
      end
Clear cached instances.

This should be called before serializing a package (see {Package#serialize} and
{Package#to_stream}) to make sure that serialization is idempotent (i.e.
Relationship instances are generated with the same IDs everytime the package
is serialized).

Also, calling this avoids memory leaks (cached instances lingering around
forever).