Improve scrollback cleanup efficiency.

Use a threshold to no delete single lines but many lines at once - improves
the speed of short outputs (ls, git status, ...) when the scrollback is
already at its limits.

Use a DOM range and .deleteContents instead of a loop and .removeChild to
get rid of scrollback lines.