refactor-864370: Prevent output

Previously this test created output, which tests are not supposed to do
this version doesn't.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Optimize command predictions

Previously we were asking for predictions twice per key-press, even when
we had all we needed from an exact match. Now we delay asking for
predictions to save the extra lookup.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Allow command type to allow parent commands

Commands like 'context' work with parent commands which are not
executable. However obviously to execute a command, it needs an exec
function. So we need a flag to allow non executable commands.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: exec() should check status better

Previously requisition.exec() assumed that status==VALID and it threw
if there was no command. Now it properly checks for status==VALID and
returns an Output object otherwise.
This means that we can remove the logic which duplicates this from
callers of exec()

Signed-off-by: Joe Walker <jwalker@mozilla.com>
output-901602: Add convert to Output

This allows us to simplify a number of functions that call
converters.convert() using the data in output.convert().

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Minor tidy-ups

Biggest change is to remove some deprecated (and broken) options from
requisition.exec()

Signed-off-by: Joe Walker <jwalker@mozilla.com>
output-901602: Have Output.promise resolve with itself

Previously there was a nasty thing where requisition.exec() returned an
output object, directly. output.promise resolved when the command was
complete, but with undefined, and the data stored on the output object.
This was for historical reasons, but now output.promise resolves with
itself, and all uses of requisition.exec() use the output object using
the 'then' function rather than directly in the return value.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Move server/index into gcli.js

No need for Mozilla review.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
output-901602: exec should return a promise not an output

Now that output.promise resolves with itself, we can return a promise
directly from requisition.exec()

Signed-off-by: Joe Walker <jwalker@mozilla.com>
output-901602: Don't reject output on error - resolve

Previously when a command failed it rejected the promise, since the
bot reject and resolve both used an Output object, and the Output object
contained an error field we don't need reject, and it's actually
annoying because we generally want to do that same thing (i.e. display
the data) both ways.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Simplify NodeJS start script

No need for Mozilla review. Basic tidy up of top level gcli.js

Signed-off-by: Joe Walker <jwalker@mozilla.com>
jshint-901598: Fix JSHint issues

Signed-off-by: Joe Walker <jwalker@mozilla.com>