Mix tests aware of Windows' esoteric newline behavior

Windows exhibits a couple of strange behavior regarding newlines:
1. Since Windows uses `CR+LF` rather than `LF`, `\n` becomes `\r\n`.
2. `echo` doesn't trim its output.

This commit makes the shell test aware of this, although it's more of a workaround than anything.