Add CSRF-protection to writeJSON by default

- Renamed writeJSON to writeJSONUnprotected for unprotected JSON.
- writeJSON now prefixes the JSON with ")]}',\n" which is
  stripped away by AngularJS by default.
  Documented how to achieve the same with a jQuery front-end.
- Added new function writeJSONWrapped with configurable wrapping.
- Added new function writeJSONP for JSONP output.