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
repl: fix color detection on windows
repl: bind Delete key
repl: don't ignore --no-history option

Also, hoist all the using/imports to the top.
cleanup base/Terminals.jl

- fix cmove_* fallbacks
- remove unused Colors & Attributes code
- get rid of submodules
- deindent
Merge pull request #6270 from JuliaLang/mn/newrepl

new REPL