Port of https://github.com/github/hubot-scripts/blob/master/src/scripts/javascript-sandbox.coffee