Add support for JSON files, and __dirname

Get the fix they did to include the "constants" builtin module.
fix for #87