Add an optional stream argument to all print and output functions.