Renamed repl function, flush buffer at prompt, resugared