- Init cin/cout/clog as early as possible using compiler specific attributes
- Set unitbuf for cerr as required by standard
- Move the streambuf out into own header and make the read/write function (to console) mockable
- Split test into small, named functions