Introduce `splice_buffer!` abstraction for IOBuffer in the REPL

~~Removes all text between from and to, keeping the position stable with the text.~~ Behaves just like `splice!` for arrays, except that it accepts 0-indexed positions and keeps the cursor position stable with the text. Minor behavior change to kill_line -- when killing just a newline, the newline char itself goes into the buffer.

Takes the abstraction from #6427 that @carlobaldassi found useful.