See http://stackoverflow.com/questions/195149/is-it-possible-to-sandbox-javascript-running-in-the-browser