Escape line endings before attempting to convert to json

When attempting to send back line endings PhantomJS will blow up because JSON won't parse
line ends inside object values, I attempted to write a spec for this but couldn't get the
server to serve up the right line endings, I know this is triggered by a "windows" \r\n...