Made the cache handle circular dependancies and parallel runs of the same test.