I haven't had a chance to help review this in full, but these should be JSON.parse/generate (with `quirks_mode`) as pointed out in the original discussion