changed report-error api.
Added exit hook to REPL.