(CFACT-91) Clean up interface for process_stream

Use strings in the yield_input closure passed to process_stream for a more consistent interface.
We have to abuse STL strings a little to avoid copies with C-api calls, but this usage is
conformant to C++11 (the buffer is guaranteed contiguous, and resize fixes the string metadata).