refactor-864370: Use context.update[Exec] more

2 places where we would have used context.update() and
context.updateExec() had they been available when they were written.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Make conversions less smart

Just like the dangers of content-type sniffing, so we shouldn't be
guessing at the type of data as we convert it.

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

Was only an experiment, was commented out, and isn't useful.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Allow types without inheritance

Having to inherit from a type exported by GCLI is annoying because it
means a require step, and some fragility from inheritance. We have done
some work to allow a JSON like declaration of a type (much like how a
command is implemented) but previously it was only of any use if you
wanted to 'extend' the selection type. This change is more consistent
about copying properties allowing the implementation of any time using
a JSON structure.

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

Unindent wrongly indented code.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Add addItems() API

Having [add|remove][Command|Type|Converter|etc] is nice, but we often
want to register a bunch of things so we add a module that pulls
together all the addFoo()/removeFoo() commands, and adds a addItems()
and removeItems().

A command, converter, etc declares what type of thing it is using the
'item' property which should be one of 'command', 'setting', 'field',
'type' or 'converter'.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Use items rather than startup/shutdown

Previously many modules has startup() and shutdown() functions which
was more verbose than it needed to be, and meant that we were wanting
mozcmd files to register stuff in a different way to GCLI itself.

This changeset is large but it just does the following:
* Adds "item:..." properties to commands/converters/etc
* Removes startup and shutdown functions in place of a items array
* Alters the calling of startup to use addItems on the exported items
* Breaks down large collections of commands/types into smaller units
* Removes places where commands were duplicated between the server and
  the client

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: default parent to root type

If the parent type isn't specified then assume that we're targeting
the basic top level type as a parent.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Fix incorrect file headers

We changed from BSD to ASF2.0 ages ago, but apparently some files got
missed out - I suspect they were branched off before the change or
something similar.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
filetype-767587: Add filesystem module

Add a dead simple filesystem module that has only a stat function right
now.
Only mozilla/util/filesystem.js needs review, the other changes don't
affect mozilla-central.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Remove motivate() naffness

Which also means we are returning a string rather than html.

Does not need review for mozilla-central.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
filetype-767587: Add 'file' type

Builds on the filesystem.js module added. Demo commands and tests to
follow.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
filetype-767587: 'file' type unit tests and demos

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Fix Settings.getSetting bug

In GCLI settings names are short simple things, bug prefs in Firefox are
generally longer, so there is a prefix that we use when a GCLI setting
is stored in a Firefox pref. getSetting was failing to use this prefix.

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