Introduced caching for active links, so that per-tick checking is now O(1)
or very close.  Simulations do not slow down in the later stages when
there are a small number of active links.