#176 Refactored printing to stream, added 'trailing_newline' argument to printing functions