code: function State(actorId, session, opts) {
  	if (!this || this.archivist) {
  		throw new Error('`this` context is incorrect, did you forget to use the `new` keyword?');
  	}
  
  	opts = opts || {};
  
  	this.actorId = actorId ? ('' + actorId) : undefined;
  	this.acl = [];
  
  	// Information for command response output:
  	this.errorCode = undefined;   // JSON serialized error code to a user command
  	this.response = undefined;    // JSON serialized response to a user command
  	this.myEvents = [];           // array of event entries that contain JSON serialized events
  
  	this.otherEvents = {};	// events for other actors: { actorId: [ list of events ], actorId: etc... }
  	this.broadcastEvents = [];
  
  	// Available in user commands, gives you the name of the appName where the command is running
  	setFromOpts(this, opts, 'appName', undefined);
  	setFromOpts(this, opts, 'description', undefined);
  	setFromOpts(this, opts, 'cacheTimeout', 500);
  
  	// This is used to carry data around through the execution path
  	setFromOpts(this, opts, 'data', {});
  
  	// Register session
  	this.session = null;
  
  	if (session) {
  		this.registerSession(session);
  	};
  
  	// Setup archivist
  	this.archivist = new Archivist(this);
  
  	exports.emit('created');
  }
docs: State class
  
  The state library exposes a constructor that constructs objects which form an interface
  between an actor, a session and the archivist. Virtually any command that involves reading
  and modification of data should be managed by a state object.
  
  When you’re done using the state class, always make sure to clean it up by calling close() on it.
  MAGE’s module and command center systems that bridge the communication between client
  and server use the State object for API responses and server-sent events.
  
  @param {*} actorId
  @param {*} session
  @param {*} opts