Fix module.exports for Browserify

The global is not window in Browserify so the key variable is undefined. Use local assignKey to define the export.