Add JSON formatting for analytics to improve human-readability
The analytics for StupidRobot exports event logs as JSON files. This commit
adds whitespace to the encoded JSON data before exporting it, making the files
accessible to people as well as other programs.

The JSONFormat class extends the existing CJSON class with formatting
capabilities. It implements the JSON formatter used in Chris Dary's JSON linter
(http://github.com/arc90/jsonlintdotcom), which is under the MIT License.

Other changes:
 - Remove duplicate code in mg.game.api.js (sendLog now calls logEvent to log
   the "close window" event).