 + * A wrapper to take care of the functions concerning an input element
 + */
 +function Inputter(options) {
-+    if (!inputterCssImported && !options.preStyled) {
-+        dom.importCssString(inputterCss, this.doc);
-+        inputterCssImported = true;
-+    }
-+
-+    this.requ = options.requisition;
-+
-+    // Suss out where the input element is
-+    this.element = options.inputElement || 'gcliInput';
-+    if (typeof this.element === 'string') {
-+        this.doc = options.document || document;
-+        var name = this.element;
-+        this.element = this.doc.getElementById(name);
-+        if (!this.element) {
-+            throw new Error('No element with id=' + name + '.');
-+        }
-+    }
-+    else {
-+        // Assume we've been passed in the correct node
-+        this.doc = this.element.ownerDocument;
-+    }
-+
-+    this.element.spellcheck = false;
-+
-+    // Used to distinguish focus from TAB in CLI. See onKeyUp()
-+    this.lastTabDownAt = 0;
-+
-+    // Ensure that TAB/UP/DOWN isn't handled by the browser
-+    event.addCommandKeyListener(this.element, this.onCommandKey.bind(this));
-+    event.addListener(this.element, 'keyup', this.onKeyUp.bind(this));
-+
-+    // Use our document if no other is supplied
-+    options.document = options.document || this.doc;
-+
-+    if (options.completer == null) {
-+        options.completer = new Completer(options);
-+    }
-+    else if (typeof options.completer === 'function') {
-+        options.completer = new options.completer(options);
-+    }
-+    this.completer = options.completer;
-+    this.completer.decorate(this);
-+
-+    // Use the provided history object, or instantiate our own.
-+    this.history = options.history = options.history || new History(options);
-+    this._scrollingThroughHistory = false;
-+
-+    // cursor position affects hint severity.
-+    event.addListener(this.element, 'mouseup', function(ev) {
-+        this.completer.update();
-+    }.bind(this));
-+
-+    this.requ.inputChange.add(this.onInputChange, this);
++  if (!inputterCssImported && !options.preStyled) {
++    dom.importCssString(inputterCss, this.doc);
++    inputterCssImported = true;
++  }
++
++  this.requ = options.requisition;
++
++  // Suss out where the input element is
++  this.element = options.inputElement || 'gcliInput';
++  if (typeof this.element === 'string') {
++    this.doc = options.document || document;
++    var name = this.element;
++    this.element = this.doc.getElementById(name);
++    if (!this.element) {
++      throw new Error('No element with id=' + name + '.');
++    }
++  }
++  else {
++    // Assume we've been passed in the correct node
++    this.doc = this.element.ownerDocument;
++  }
++
++  this.element.spellcheck = false;
++
++  // Used to distinguish focus from TAB in CLI. See onKeyUp()
++  this.lastTabDownAt = 0;
++
++  // Ensure that TAB/UP/DOWN isn't handled by the browser
++  event.addCommandKeyListener(this.element, this.onCommandKey.bind(this));
++  event.addListener(this.element, 'keyup', this.onKeyUp.bind(this));
++
++  // Use our document if no other is supplied
++  options.document = options.document || this.doc;
++
++  if (options.completer == null) {
++    options.completer = new Completer(options);
++  }
++  else if (typeof options.completer === 'function') {
++    options.completer = new options.completer(options);
++  }
++  this.completer = options.completer;
++  this.completer.decorate(this);
++
++  // Use the provided history object, or instantiate our own.
++  this.history = options.history = options.history || new History(options);
++  this._scrollingThroughHistory = false;
++
++  // cursor position affects hint severity.
++  event.addListener(this.element, 'mouseup', function(ev) {
++    this.completer.update();
++  }.bind(this));
++
++  this.requ.inputChange.add(this.onInputChange, this);
 +}
 +
 +/**
 + * Handler for the Requisition.inputChange event
 + */
 +Inputter.prototype.onInputChange = function() {
-+    this.element.value = this.requ.toString();
-+    this.completer.update();
++  this.element.value = this.requ.toString();
++  this.completer.update();
 +};
 +
 +/**

+ * prepended with commandAssignment.getArg()
+ */
+Requisition.prototype.getAssignments = function(includeCommand) {
+    var assignments = [];
+    if (includeCommand === true) {
+        assignments.push(this.commandAssignment);
+    }
+    Object.keys(this._assignments).forEach(function(name) {
+        assignments.push(this.getAssignment(name));
+    }, this);
+    return assignments;
+};
+
+/**
+ * Reset all the assignments to their default values
+ */
+Requisition.prototype.setDefaultArguments = function() {
+    this.getAssignments().forEach(function(assignment) {
+        assignment.setDefault();
+    }, this);
+};
+
+/**
+ * Extract a canonical version of the input
+ */
+Requisition.prototype.toCanonicalString = function() {
+    var line = [];
+
+    var cmd = this.commandAssignment.getValue() ?
+            this.commandAssignment.getValue().name :
+            this.commandAssignment.getArg().text;
+    line.push(cmd);
+
+    Object.keys(this._assignments).forEach(function(name) {
+        var assignment = this._assignments[name];
+        var type = assignment.param.type;
+        // Bug 664377: This will cause problems if there is a non-default value
+        // after a default value. Also we need to decide when to use
+        // named parameters in place of positional params. Both can wait.
+        if (assignment.getValue() !== assignment.param.defaultValue) {
+            line.push(' ');
+            line.push(type.stringify(assignment.getValue()));
+        }
+    }, this);
+    return line.join('');
+};
+
+/**

+ * depending on the value of <tt>include</tt>
+ */
+dom.setCssClass = function(node, className, include) {
+  if (include) {
+    dom.addCssClass(node, className);
+  } else {
+    dom.removeCssClass(node, className);
+  }
+};
+
+/**
