Rewrite the REPL.