Use window instead of this because it breaks if put into an IIFE with a modify context.
Simplify exporting window / amd / cjs.
Merge pull request #612 from treshugart/master

Simplify exporting of window / amd / cjs.