     throw new Error("Could not parse " + val)
 
 root.store = (key, val) ->
+    ###
+        Internal Function (used only by the code in this file)
+
+        JSON-ifies the given value and stores it in the localstorage
+        associated to the given key.
+
+        @param key
+            The key which which to associate the stored data.
+        @param val
+            The data to store.
+    ###
     throw new Error("Value must exist") unless val?
     root.setString(key, JSON.stringify val)
     return
 
 root.loadGameStats = (gameKey) ->
-    p=root.getPlayer()
+    ###
+        Internal Function (used only by the code in this file)
+
+        Returns the game statistics for the game associated with gameKey.
+        Returns default values for all statistics shouled the game not
+        exist.
+
+        @param gameKey
+            The gameKey with which the game we want the statistics for
+            is associated.
+    ###
+    p = root.getPlayer()
     data = p.games[gameKey] ?= {}
-#Ensure we have the minimum number of expect properties
+    #Ensure we have the minimum number of expect properties
     data.abortCount ?=0
     data.runCount ?=0
     data.winCount ?=0

    return

root.addHintsToCode = (gameData) ->
    gameData.code.initial?=''
    if gameData.code.comments
        # Also ensures newlines in the data are properly commented out
        one = '// '+ ((gameData.code.comments.join('\n')).replace(/\n/g,'\n// '))+ '\n'

    return

root.convertShorthandToCode = (gameData) ->
    ###
        Internal Function (used only by the code in this file)

        Converts the shorthand code found in the game's json config
        to actual java code.

        @param gameData
            The game's data.
    ###
    if gameData.code.initial?
        return
    initial = ''
