MDN polyfill

Pulling in most of the tweaks from the MDN polyfill.