clean up REPL errors using @epidemian's approach from

jashkenas/coffee-script#2723