REPL multi-line and history support (take 2)

Trying with a new branch