Added an optimization that allows extensions to cache information from the latest commit. If an extension requires initial state to be built (in prepareIfNeeded), then it can use this optimization to sometimes do so without any disk IO.