Rework the implementation of the shimMap to ensure iterators will behave the same as with native Maps.
Rework the implementation of the shimMap to ensure iterators will behave the same as with native Maps.

This includes:
- Entries are visited in insertion order
- New entries added during iteration will be visited
- Entries that are removed during iteration (before being visited) will not be visited

Fixes #26090

weswigham/TypeScript,nojvek/TypeScript,SaschaNaz/TypeScript,kitsonk/TypeScript,weswigham/TypeScript,kitsonk/TypeScript,RyanCavanaugh/TypeScript,RyanCavanaugh/TypeScript,nojvek/TypeScript,Microsoft/TypeScript,microsoft/TypeScript,SaschaNaz/TypeScript,Microsoft/TypeScript,kpreisser/TypeScript,microsoft/TypeScript,alexeagle/TypeScript,nojvek/TypeScript,SaschaNaz/TypeScript,SaschaNaz/TypeScript,minestarks/TypeScript,kpreisser/TypeScript,weswigham/TypeScript,minestarks/TypeScript,alexeagle/TypeScript,nojvek/TypeScript,Microsoft/TypeScript,RyanCavanaugh/TypeScript,minestarks/TypeScript,alexeagle/TypeScript,kpreisser/TypeScript,kitsonk/TypeScript,microsoft/TypeScript