import REPL.jl code

Fixes #1773 (Repl autocompletion for composite type fields).
Fixes #3652 (Segfault during TAB-completion on OSX).
Fixes #4477 (Tab completion for `using` should look up installed packages).
integrate REPL.jl code into Base
expunge readline
fix repl crash when tab-completing type field
fix repl crash when pasting trailing newlines
add old-repl path completion behavior to new-repl

Cf. #5343
fix buffer size bug in Readline.edit_replace

A symptom of this is if

    ext(c)<left><left><left><tab><enter>

is entered into a fresh session, the output is

    extrema (generic function with 2 methods)

instead of the expected

    ERROR: c not defined