Added polyfill for ES6 WeakMap.