Refactor tests to use a input -> TTY output converter.
Fix newline handling. (how did it take this long?! Fix rtorrent!)