Mutable version of UnitIndex.
The UnitIndexCache ensures that all calls to initUnits will
share the UnitInfo if it is possible.
To share the UnitInfo, the UnitInfo needs to be fully-resolved, i.e., its wired-in dependencies and modules need to be replaced with the UnitId of the wired-in unit. Thus, the UnitIndexCache caches both the global WireMap and the UnitInfoMap.
The WireMap is globally valid, as other parts of the compiler rely on the fact that only one instance of wired-in units is used.
Memory Invariant: The UnitIndexCache is the root object for retaining fully-resolved
UnitInfo. UnitState is expected to reference only UnitInfos from the UnitIndexCache.
There is exactly one fully-resolved UnitInfo alive for each external unit per unit database.
A second instance may or may not be stored in the externalUnitDatabases, which represent the in-memory cache of the on-disk unit databases.