Use a WeakSet to track invariant dependencies

There's no point in keeping TVars around just because an invariant function accessed them on its last run, so don't.