refactor-864370: s/mockCommands/exports/g

We're trying to remove aliases of exports, this is one more down.
Also add 'use strict' and move the setup/shutdown to the bottom where
everything has been clearly defined.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: use canon/converters/types to avoid loops

The ordering of the imports was causing problems in the Firefox loader.
So we alter the source order to prevent this.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Remove context.createPromise

It's been marked deprecated for ages, we've removed all the uses from
Firefox, plus the extra code is confusing, so it's time for it to go.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: s/exception/error/g

Having a type called 'exception' is confusing because it could be the
result of a rejected promise, so we use the slightly more generic
'error' instead.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Fix errors from using output.promise

A while ago we replaced uses of Output.onChange with output.promise but
didn't register an error handler when doing output.promise.then.
This makes up for that mistake. Now errors show properly.

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

A better variable name, improved error message, remove an error handler
that didn't add anything except duplicate messages, and remove a
misnamed (returnType not returnValue) property in a command which was
duplicating a default anyway.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Add tests for failing commands

This includes a minor change to cli.js to make sure that type data
from an error gets through.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Switchable error logging

Having command failures logged to the console is useful so we should
do it consistently, but it's annoying when testing so we have a switch
to turn it off in tests.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotegcli-839862: Export 'connect' command

Also put the exported commands in alpha order.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotegcli-839862: Cu -> Components.utils

We've not aliased it here, and there doesn't seem like there is much
point in creating an alias for one line.

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