handle piping and redirecting into the repl. fixes #4537

also some code cleanup in the repl

adding Base.parse_input_line(IO) that incrementally parses multiline
input from an IO stream, a line at a time.
Merge branch 'master' of github.com:JuliaLang/julia