Rewrite JSON string parser so it does not choke on escaped backslash before end of string