fix mac os x work (?); move common global vars to globals.js
Merge pull request #17 from dryabov/master

Fix work on Mac OS X