JSON CGI: Now escaping all required characters

This commit implements escaping for all characters required by the JSON
specification.