Overhaul scrolling system

Implement a scrolling model that is much closer to what other
graphical terminal emulators use (for details, see comments in
TerminalOutput.vala), resulting in substantial compatibility
improvements (e.g. with "top").

Fix a number of other scrolling-related problems.