docs: function validateExtendedStep(stepId, update, updateFunction) {
          var errBegin;
          if (updateFunction) {
              errBegin = 'Stager.extendStep: update function must return ' +
                  'an object with ';
  
              if (!update || 'object' !== typeof update) {
                  throw new TypeError(errBegin + 'id and cb. Found: ' + update +
                                      '. Step id: ' +  stepId);
              }
              if (update.id !== stepId) {
                  throw new Error('Stager.extendStep: update function ' +
                                  'cannot alter the step id: ' + stepId);
              }
              if ('function' !== typeof update.cb) {
                  throw new TypeError(errBegin + 'a valid callback. Step id:' +
                                      stepId);
              }
              if (update.init && 'function' !== typeof update.init) {
                  throw new TypeError(errBegin + 'invalid init property. ' +
                                      'Function or undefined expected, found: ' +
                                      typeof update.init + '. Step id:' +
                                      stepId);
              }
              if (update.exit && 'function' !== typeof update.exit) {
                  throw new TypeError(errBegin + 'invalid exit property. ' +
                                      'Function or undefined expected, found: ' +
                                      typeof update.exit + '. Step id:' +
                                      stepId);
              }
              if (update.done && 'function' !== typeof update.done) {
                  throw new TypeError(errBegin + 'invalid done property. ' +
                                      'Function or undefined expected, found: ' +
                                      typeof update.done + '. Step id:' +
                                      stepId);
              }
          }
          else {
              if (update.hasOwnProperty('id')) {
                  throw new Error('Stager.extendStep: update.id cannot be set. ' +
                                  'Step id: ' + stepId);
              }
              if (update.cb && 'function' !== typeof update.cb) {
                  throw new TypeError('Stager.extendStep: update.cb must be ' +
                                      'function or undefined. Step id:' +
                                      stepId);
              }
              if (update.init && 'function' !== typeof update.init) {
                  throw new TypeError('Stager.extendStep: update.init must be ' +
                                      'function or undefined. Step id:' +
                                      stepId);
              }
              if (update.exit && 'function' !== typeof update.exit) {
                  throw new TypeError('Stager.extendStep: update.exit must be ' +
                                      'function or undefined. Step id:' +
                                      stepId);
              }
              if (update.done && 'function' !== typeof update.done) {
                  throw new TypeError('Stager.extendStep: update.done must be ' +
                                      'function or undefined. Step id:' +
                                      stepId);
              }
  
          }
      }