Bug 908168 - make perf: Measure the time it takes to setup a ctx. r=gandalf
Bug 802850 - Debug, error and warning strategy. r=gandalf

The code changes are relatively few, most of the patch are tests for locale
fallback and accompanying events.

Below is the breakdown of the errors and warnings that we emit and log in the
console by default.  This is in line with Gandalf's idea to log broken
translations as errors and missing translations as warnings.  The reason is
that a developer or a localizer will likely want to see when they've broken an
entity (syntax error, reference error) as their intent was to have that entity
show up.  OTOH, if an entity is missing from the resource completely, then we
only emit a warning which can be filtered nicely in the console.  This way, you
can start localizing with a small number of entities in your locale and we will
only show you errors if what you typed in the resource file is wrong.

 - `error` - fired when an error occurs which prevents the `Context` instance
   from working correctly or when the existing translations are buggy.  The
   error object is passed as the first argument to `callback`.  These errors
   include:

   - native JavaScript errors (`TypeError`, `ReferenceError` etc.) (this might
     get changed by bug 869016),

   - `Context.RuntimeError`, when an entity is missing or broken in all
     supported locales;  in this case, L20n will show the the best available
     fallback of the requested entity in the UI:  the source string as found in
     the resource, or the identifier.

   - `Context.TranslationError`, when the translation is present but broken
     in one of supported locales;  the `Context` instance will try to retrieve
     a fallback translation from the next locale in the fallback chain,

   - `Parser.Error`, when L20n is unable to parse the syntax of a resource;
     this might result in entities being broken which in turn can lead to above
     error being emitted.

 - `warning` - fired when a less serious error occurs from which the `Context`
   instance can recover gracefully and try to fetch a translations from
   a fallback locale.  The error object is passed as the first argument to
   `callback` and can be one of the following:

   - `Context.Error`, when there are problems with setting up resources (e.g.
     a 404 error when fetching a resource file, or recursive `import`
     statements in resource files),

   - `Context.TranslationError`, when there is a missing translation
     in one of supported locales;  the `Context` instance will try to retrieve
     a fallback translation from the next locale in the fallback chain,

   - `Compiler.Error`, when L20n is unable to evaluate an entity to a string;
     there are two types of errors in this category: `Compiler.ValueError`,
     when L20n can still try to use the literal source string of the entity as
     fallback, and `Compiler.IndexError` otherwise.
Bug 869016 - Remove promises. r=gandalf
Don't replace whole nodes when localizing nodes with overlays.

When using L20n DOM overlays, the source node gets replaced using
the replaceChild method on the parent node. This can cause problems
for some frameworks expecting to keep handle of their respective nodes,
this can break bound event handlers etc., especially in a scenario
where L20n document.l10n.localizeNode is fired asynchronously.

This commit changes the overlay feature to just replace node contents
instead of replacing the whole node.