remotetest-874821: Sync promise implementation with central

We were using an old version of the promise library from the add-on SDK
we're now in sync. This means we can:
* Convert from util.promised and util.all to the versions in Promise
* Remove those functions from util
* Set Promise._reportErrors=true in test mode

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Handle exceptions in helpers._exec

Previously they would bounce up and get lost.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Simplify util.promiseEach

I suspected a bug with replies being reset, and the logic was confusing
so I refactored.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Improve error reporting

Several reporting updates:
* Make helpers.js clear that regexps are that by surrounding with //
* Fix the failure.message -> message in assert
* Improve reporting in examiner.js
* Be explicit about outstanding requests in disconnect

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Add terminal->string converter

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Prioritize args over command in testing

In helpers.audit() we allow the 'arg' check to check the command itself,
but what if the command has a parameter called 'command' (for example,
an 'exec' command)? We now default to using the parameter because
checking the command value is less useful.

Also we don't need to create a new node in order to convert output.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: sleep command returns a string

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Add --force option for disconnect

Also add a missing promise import.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Enable un-remotable commands

Add a noRemote flag to prevent commands from being remoted.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Support context in remoted commands

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

Better test case creation, and remote unused argument.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Add remote unit tests

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