hidden-773347: Fix option.hidden handling

option.hidden handling was done by CommandType (brokenly), but it really
needs to be done for all selection types.
We shouldn't be excluding exact matches when they're hidden, just not
providing help to get there.
hidden-773347: Allow hidden parameters

Bonus DVD extra.
paramSpec is what the user passes to 'addCommand' in the param section.
By reflecting the 'hidden' attribute in the Parameter class then we get
the (nearly) free bonus feature of hidden parameters.
hidden-773347: Unit tests
Merge branch 'hidden-773347' into landing

Conflicts:
	lib/gcli/types/selection.js
hidden-773347: mirror hidden properly

Using "== null" meant that undefined values came across as 'true' which is
wrong because undefined should mean false (failing to specify hidden:true
means that you're not hiding) So we just pass the hidden property through
without changes.
options-775031: Expose Command.hasNamedParameters

A command has named parameters if any of its parameters is not positional.
Example of using positional parameters (with mythical copy command):
>> copy a.txt b.txt
Example of using named parameters:
>> copy --source a.txt --dest b.txt
There are benefits of both systems.
options-775031: Add '[options]' to hints

We add '[options]' when there is at least one remaining named parameter,
which is not hidden and which doesn't already have a value associated with
it (i.e. the argument type is not 'BlankArgument').
Also we need to add an nbsp before the '[options]' if there isn't already
a space at the end of the command line.
Also update the many tests affected by this change, and add some new ones.
hidden-773347: Remove duplicate test
Merge branch 'hidden-773347' into options-775031

Conflicts:
	lib/gclitest/testIncomplete.js
boolgroup-773565: Named param proposals need spaces

Previously when there were predictions in the arguments to named parameters
we were presenting them without a space. For example if | represents the
cursor we would do this:
>> copy --source|readme.txt
Rather than:
>> copy --source| readme.txt
(The readme.txt is a different color to indicate it's a completion)

The fix involves checking for a NamedArgument without a space at the end of
the prefix and then adding a space to the beginning of the proposal.

We also remove the [options] marker whenever we have a tab proposal, which
is clearer in general, and rename optionsRemaining to addOptionsMarker
since the calculation now involves more than just 'are there options
remaining'.
boolgroup-773565: Rationalize tslong mock command

'tslong' was originally taken straight from the 'jsb' command which
demonstrated a number of issues with GCLI. The parameters were thus rather
arbitrary since they reflected a real world command rather than something
that we were trying to test for.
namedhint-770830: Better hints for named parameters

This is related to my fixes for Bug 773565, and included there for
simplicity.

Previously, we didn't do much with:
>> git commit --message
But we wanted to tell the user they needed to type a message. The previous
commit in this branch added tab completion for named parameters when there
was a prediction, but for things like strings and numbers, we can't make
any useful predictions, so we do the next best thing and tell them what
they need to type using the type name.

The substance of these changes is in the first 2 hunks of completer.js.
The final hunk of change to completer.js looks big but really it's just
the addition of an if statement, which increases the indent of a number of
lines. We're saying if we added a prompt for a string or number above then
don't make any other prompts untill they've completed this task.
boolgroup-773465: Consistent error handling

We setup a Command and set of Parameters when addCommand is called, and
do some basic sanity checking on the data passed in. Previously we were
inconsistent about reporting through console.error or throwing. Experience
has shown that particularly with the noisy Firefox console, that errors
can get lost. So now we throw for all errors.

This changeset also aligns continuation indents with start of string.
Previously continuation indents were 2, 4 or 8 spaces.
boolgroup-773465: Allow strings in emptyParameters

Helpers.check() used to require an array for emptyParameters, but that's
unnecessarily verbose. So now we allow strings, and I threw a regex at the
unit tests to convert the existing arrays to strings.

The code in Helpers is updated in 2 places: check() and status(). status
is the older version of check which has not been purged yet.

The Array version has been kept even though the tests in GCLI don't use it
any more because very similar versions of check() and status() exist in
Firefox (in head.js for the command line), and I'd like to keep the code
in sync as much as possible.
boolgroup-773565: Provide hints for named args

Don't stop presenting hints just because the current argument is a named
argument.

Also make a minor clarification to some documentation.

## About this direction

I've gone both ways on providing hints other arguments while editing
named arguments, and I'm still not 100% sure, but this, I think is the
best route for now.

For example, what should be the hints for the following input, given that
the 'git tag' command requires a tag name and can optionally take a
message [1]:
>> git tag --message foo|

Option 1: Show required params, and options as normal:
>> git tag --message foo|
                          <tag> [options]

Options 2: Show the hints only when we're clearly done with the named arg:
>> git tag --message foo|

>> git tag --message foo |
                          <tag> [options]

For now we're doing option 1.

For the alternative, see boolgroup-773565-experiment.

[1] In reality 'git tag' uses a '-m' prefix for the message, but we're
    showing it here as '--message' to fit the way GCLI currently works.
boolgroup-773565: Tweak/fix Argument.beget()

Arguments are what the user types into the command line. They are designed
to be immutable because a Conversion links an Argument to the value that it
represents, and it can't do that if the Argument changes underneith it.

So when we want to change an Argument (for example completion) then we need
to create a new Argument based on the old one. Hence the beget() function.

beget used to take 2 parameters, the new text and an options object. But
there were 2 problems:
- What if you didn't want to change the text (completion sometimes just
  wants to add a space to the prefix/suffix for example)
- The implementation was terrible in that it did different things just if
  there was an empty options object.

Solution: merge the replText parameter into the options object. Now it is
easier to extend to allow us to alter the prefix/suffix too.

This is a particular issue because MergedArguments were being messed up by
the completion process so we want to create a smart MergedArgument.beget()
boolgroup-773565: Reduce stacktrace length

This change will not reach Firefox, so feel free to skip review.

Running tests on every startup is nice, but doing it in the initial page
load makes for very long stacktraces which include all RequireJS frames so
we just setTimeout to get rid of them.
boolgroup-773565: Update Argument.beget

Make all options be optional (i.e. text)
Return 'this' if nothing has changed
Add 'suffixSpace' option to be used in completion
Make ScriptArgument.beget use Argument.beget
Move the 'moveSpaces' calculation to its own function so it can be shared
  between the ctor and beget
Remove the special ScriptArgument.beget({ normalize: true }) option
  SelectionTooltipField should never have used it, also fix the text param
  JavascriptField can create a new ScriptArgument instead and should do
    this consistently.
Have Requisition.complete use beget({ suffixSpace:true })
boolgroup-773565: Don't use exports alias

Previously we aliased 'exports' so when we moved code from one module to
another, we wouldn't need to redirect calls to functions in the original
module. While a worthy goal, it's often confusing, and in this case not
relevant because there isn't any of that kind of intra-module function
calling.
boolgroup-773565: Move incr/decr to Requisition

Minor refactor: We're debugging completion, part of which is making
Requistion.setAssignment() update the underlying arg list properly. If we
make the increment and decrement process be part of Requisition (rather
than Assignment) then we can get them to use Requistion.setAssignment()
too.

In general, the events that GCLI uses to update various parts of the UI
are too complex. This is, in part, due to Assignments being adjustable by
the UI directly, so the Assignments need to inform the Requisition that
they have changed, so we get an event storm. This helps make Requisition
into a gatekeeper for all change.