Cache the most recently created SubstTypeMap.

I discovered that a 1-element cache for SubstTypeMaps
gave a 75-90% hit rate.
Merge pull request #2582 from paulp/pr/SubstTypeMap

Cache the most recently created SubstTypeMap.