Reassign window functions to themselves - see comment for details

Also in the PhantomJS polyfills file:
- Added comment block
- Cleaned up formatting
- Put polyfills inside IIFE