Add scoring for StupidRobot
Adds scoring to StupidRobot with a simple formula. In addition, this commit
creates a new reset action for the GamesController which saves the score to the
database (UserToGame). After saving, it resets the game engine and starts a new
played game session.

The scoring algorithm awards N points for each accepted tag, where N is the
length of the word. Thus, the maximum points possible per round is 49.

Known issues:
 - Because the reset action creates a new PlayedGame entry, it ends up adding
   one empty entry to the database per window session.
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).
StupidRobot: Fix cut to end-screen after 7 words, re_init word limit

This commit fixes the StupidRobot code intended to cut to the end-screen early
if the player enters seven accepted words. Previously, if the user entered all
seven words, they would have to wait for the timer to run out or click "Quit"
to continue.

Specifically, it fixes a conditional (acceptedWords > maxLevel) to be
(acceptedWords > maxLevel - 4) because the user cannot enter 1, 2, or 3-letter
words.

Other changes:
 - Changed definition of maxLevel in re_init to 10.
   The re_init function is intended to reset various game constants to their
   initial values. However, the maxLevel in re_init was not changed from 13 to
   10 when the original constant was. This meant that in subsequent games,
   players could type longer words, although they would not be accepted.
   (This also caused problems with the conditional mentioned above.)
StupidRobot: Add magnifying glass to image
A magnifying glass icon is now displayed in the upper left corner of the image
to indicate that the image can be zoomed. Because each image can be a different
size, the icon is positioned dynamically. Functionally, clicking on the icon is
no different than clicking anywhere else on the image, although the icon
highlights yellow when moused over.

The code where both image and icon positioning happens should be refactored in
a separate commit, as it makes multiple identical calls to the jQuery selector.
StupidRobot: Add in-game score display to final screen
Adds an in-game score display to accompany the StupidRobot scoring algorithm.
Note that the two are completely independent - while it is possible to falsify
the in-game display, it will not affect the overall scoreboard.

As a part of adding the score display, the HTML structure of the final screen
has been redone, removing the questionable use of <span> elements and
line breaks, and replacing them with a table. This also allows for easy
alignment of the score counters with their respective words. In addition, the
empty 11- to 13-letter word spaces remaining from an earlier revision have now
been removed entirely.

Aesthetic changes will likely be made to the display before merging this branch
back into the development branch, but the functionality is finished. In
addition, there is a known bug where the display will sometimes not animate;
this is an inconsistent problem and the cause is not yet known.
StupidRobot: Fix flashMessage overwriting final screen

The flashMessage function is used to display StupidRobot's response to a user
submission, first showing the response, then restoring the text to its
original prompt ("Human: what is in this image?"). However, if it was called
and then the final screen was immediately shown (either by time limit or by
clicking the "Quit" button), then it would overwrite the final response ("I
now comprehend X more words...") with the original prompt.

This was due to an HTML element ID conflict between the in-game and final
screen messages. The latter's ID has been changed from "gameMessage" to
"endgameMessage", resolving the issue.
Merge branch 'stupidrobot-score' into development

Conflicts:
	www/protected/modules/games/views/stupidRobot/index.php

The stupidrobot-score branch adds score functionality to StupidRobot, both in-
game and on the scoreboard. See the individual commits for more details.
Merge branch 'gsolbeck-development' into development: StupidRobot: add scoring, other
Merge branch 'development' into game-reskins : StupidRobot: add scoring, other