improve repl exit behavior
fix line iterator position, #2051
add experimental peek and peekchar