google closure compiler-compatible code modifications
changed WeakMap polyfill from Polymer to Brandon Benvie implementation; safety fixes implemented based on this solution