Add the ability to control whether the pretty printer uses line breaks

This change makes it possible to more reliably write unit tests which check
that an expression is equivalent to an expected pretty printed string.