Fixing some polyfills, and repurposing the polyfill file to be a general-purpose global environment modifying module.