Bug 769234 (focus): Add missing checks for hasFocus

If the input element doesn't have focus then we shouldn't ever have either
the output or the hint area showing.
Merge branch 'master' into focus-769234
Bug 720972 (optmenu): Refactor template data generation

Previously we used the completer instance as the data for the template,
however this didn't make much sense since the set of things that were
important to templates and the set of things important to being a completer
were disjoint sets, and using properties (the old way) meant either
inefficient code that re-calculated properties, or cached values (what we
did) which caused subtle sequencing issues. Now we just have a simple
(if a little large) function to generate the template data.
Bug 720972 (optmenu): Tidy assignment constructor

Assigning to prototype like that is asking for confusion, and the point
(so that tools had something to document) hasn't happened.
So we move the docs into the constructor.
Bug 720972 (optmenu): Allow valueArg to be null

Requisition uses it with null when there is only one part of a named
argument, so we this code should accept that.
Also tidy up the over-reaching docs.
Bug 720972 (optmenu): Add _toSummaryJson

_toSummaryJson alows us to see at a glance what the state of the command
line it. This is useful partly in debugging because it saves digging down
and could be useful in testing to check the state of a large number of
things at the same time, however we will need to ensure that it's stable
before using it in testing too much.
This patch also changes a demo command that we use for debugging. This
change does not reach Firefox.

REBASE: make summaryJson a property

tweak command
Bug 720972 (optmenu): Swap isBlank() for .type and BlankArgument

This gives us a bit more information about how the command line got to be
in the state that it is, it's also more consistent with how Argument works
in general. Also it means consumers of Argument do not need to import all the
subtypes in order to get type information (and it's not going to break in a
cross frame situation)
Bug 720972 (optmenu): Various minor changes

Fix minor number parsing bug: '-' is an incomplete number, not an error
We need to make it a special case because otherwise we try to parseInt it
which errors.
Remove inconsistent documentation, add thoughts on future Argument refactoring
Bug 720972 (optmenu): Support incomplete named args

Previously we supported named arguments, but we didn't cope well with
them being incorrect while they were being typed, which is clearly needed
for a menu to help.
This makes _unassigned to be an array to which we add dynamically created
instances of UnassignedAssignment rather than merging them which was always a
bit of a hack.
Bug 720972 (optmenu): Basic menu support

Create a ParamType. This also fixes a bug where an extra space was inserted in
the empty parameters, which was caused by us mutating an argument rather than
creating a new one.
Bug 720972 (optmenu): Fix bad comparison logic

Act if we've got something to act on, not if we haven't
Bug 720972 (optmenu): Extract out setAssignment

Extract out Requisition.setAssignment, so we can do the args checks properly.
We were just adding the args if they were missing, now we're also replacing
them if that needs doing too.
Bug 720972 (optmenu): Add checks for defaultValue

Optional parameters must have a defaultValue (unless they are boolean), which
is a check that we didn't make explicit before.
Bug 720972 (optmenu): Add unit tests

These test allow us to test the type of arguments, and allow testing of
different ways to get the command line into any given position.
Merge branch 'master' into optmenu-720972
tabbreak-767729: Check contents before doing compete

Being able to complete 'nothing' is OK if there is some context, but when
there is nothing on the command line it jsut looks bizarre.
moremenu-731972: Move maxPredictions to Conversion

We can now use this constant in other places in our code. This change also
does some minor tidying to use 'exports' not 'types', and to move the
export of Conversion to the end of the more conventional end-of-definition
position rather than the start
moremenu-731972: User interface changes

Replace 11th item with a 'more' item. We do it this way because it means
there is never any doubt about whether more items are there, and because
it's simple. Better fixes to this problem will come with async types.
Merge branch 'focus-769234'
Merge branch 'optmenu-720972'