Support node-webkit

In node-webkit, window and exports both exist, but exports should be
used instead of window.
String not encoded properly

unpack( pack( { x : ‘^’  } )) will gives error because ^ is not escaped
Bug fixed: % not escaped

unpack( pack( { x : ‘%7C’ } ) ) will gives { x : ‘|’ } because % is not
escaped
Merge pull request #3 from b123400/master

Support node-webkit and fixed bug