Comment/formatting changes only.
Use ungetc.

Refactor so we don't have to store the last char read. While here, fix a
bug in the print_linebreaks function. Some renaming, etc.