Modified tests to expect one line output. Also worked around some sed weirdness to make escaping backslashes and quotes work correctly.