convert some stuff to work on raw_ostreams instead of std::ostream.