Big breakthrough - so it turns out that windows systems add extra characters for end of line.  Though I knew this already I didn't expect extra characters showing up in my input and output streams.  Thus here is a way to use a more linux-like mode.