Handle double quotes, backslashes, CRs, NLs and tabs

This is not a formal solution to all escaping, but it handles the common cases.