docs: function Stager(stateObj) {
  
          // ## Properties
  
          /**
           * #### Stager.steps
           *
           * Step object container
           *
           * key: step ID,  value: step object
           *
           * @see Stager.addStep
           */
          this.steps = {};
  
          /**
           * #### Stager.stages
           *
           * Stage object container
           *
           * key: stage ID,  value: stage object
           *
           * Stage aliases are stored the same way, with a reference to
           * the original stage object as the value.
           *
           * @see Stager.addStage
           */
          this.stages = {};
  
          /**
           * #### Stager.sequence
           *
           * Sequence block container
           *
           * Stores the game plan in 'simple mode'.
           *
           * @see Stager.gameover
           * @see Stager.next
           * @see Stager.repeat
           * @see Stager.loop
           * @see Stager.doLoop
           */
          this.sequence = [];
  
          /**
           * #### Stager.generalNextFunction
           *
           * General next-stage decider function
           *
           * Returns the id of the next game step.
           * Available only when nodegame is executed in _flexible_ mode.
           *
           * @see Stager.registerGeneralNext
           */
          this.generalNextFunction = null;
  
          /**
           * #### Stager.nextFunctions
           *
           * Per-stage next-stage decider function
           *
           * key: stage ID,  value: callback function
           *
           * Stores functions to be called to yield the id of the next
           * game stage for a specific previous stage.
           *
           * @see Stager.registerNext
           */
          this.nextFunctions = {};
  
          /**
           * #### Stager.defaultStepRule
           *
           * Default step-rule function
           *
           * This function decides whether it is possible to proceed to
           * the next step/stage. If a step/stage object defines a
           * `steprule` property, then that function is used instead.
           *
           * @see Stager.getDefaultStepRule
           * @see GamePlot.getStepRule
           */
          this.setDefaultStepRule();
  
          /**
           * #### Stager.defaultGlobals
           *
           * Defaults of global variables
           *
           * This map holds the default values of global variables. These
           * values are overridable by more specific version in step and
           * stage objects.
           *
           * @see Stager.setDefaultGlobals
           * @see GamePlot.getGlobal
           */
          this.defaultGlobals = {};
  
          /**
           * #### Stager.defaultProperties
           *
           * Defaults of properties
           *
           * This map holds the default values of properties. These values
           * are overridable by more specific version in step and stage
           * objects.
           *
           * @see Stager.setDefaultProperties
           * @see GamePlot.getProperty
           */
          this.defaultProperties = {};
  
          /**
           * #### Stager.onInit
           *
           * Initialization function
           *
           * This function is called as soon as the game is instantiated,
           * i.e. at stage 0.0.0.
           *
           * Event listeners defined here stay valid throughout the whole
           * game, unlike event listeners defined inside a function of the
           * gamePlot, which are valid only within the specific function.
           */
          this.onInit = null;
  
          /**
           * #### Stager.onGameover
           *
           * Cleaning up function
           *
           * This function is called after the last stage of the gamePlot
           * is terminated.
           */
          this.onGameover = null;
  
          /**
           * #### Stager.blocks
           *
           * Array of blocks as they in the order they were added to the stager
           */
          this.blocks = [];
  
          /**
           * #### Stager.blocksIds
           *
           * Map block-id to block-position in the blocks array
           *
           * @see blocks
           */
          this.blocksIds = {};
  
          /**
           * #### Stager.unfinishedBlocks
           *
           * List of all Blocks stager might still modify
           */
          this.unfinishedBlocks = [];
  
          /**
           * #### Stager.finalized
           *
           * Flag indicating if the hierarchy of has been set
           *
           * Indicates if the hierarchy of stages and steps has been set.
           */
          this.finalized = false;
  
          /**
           * #### Stager.currentType
           *
           * Name of the stage currently worked with in building hierarchy
           */
          this.currentType = blockTypes.BLOCK_DEFAULT;
  
          /**
           * #### Stager.currentBlockType
           *
           * Indicates what type of Block was added last
           */
          this.currentBlockType = blockTypes.BLOCK_DEFAULT;
  
          /**
           * #### Stager.toSkip
           *
           * List of stages and steps to skip when building the sequence
           */
          this.toSkip = {
              stages: {},
              steps: {}
          };
  
          /**
           * #### Stager.defaultCallback
           *
           * Default callback assigned to a step if none is provided
           */
          this.defaultCallback = Stager.defaultCallback;
  
          /**
           * #### Stager.cacheReset
           *
           * Cache used to reset the state of the stager after finalization
           */
          this.cacheReset = {
              unfinishedBlocks: []
          };
  
          /**
           * #### Stager.log
           *
           * Default standard output. Override to redirect.
           */
          this.log = console.log;
  
          // Set the state if one is passed.
          if (stateObj) {
              if ('object' !== typeof stateObj) {
                  throw new TypeError('Stager: stateObj must be object.');
              }
              this.setState(stateObj);
          }
          else {
              // Add first block.
              this.stageBlock(blockTypes.BLOCK_DEFAULT, 'linear');
          }
      }