A function for evaluating sandboxed javascript