Replace a shared object with an instance of a class that wraps Map.
The new cache implementation takes window.CANONICAL_PATH into account.
If PolyGerrit is embedded in an environment where some elements are used
before CANONICAL_PATH is set, they would potentially poison the cache.
Change-Id: I43b0d988f2e371caab48934ee101f7d7e723037d
(cherry picked from commit 24a01b06f0)