Add error handler to detect unhandled Promise errors.

Use unhandledPromise-errback.
Fix bug: RuleControler.prototype.reloadRules getting stuck after an error.

Before requesting new rules, we deleted the old rules
to clear the cache. This lead to a moment where requests
to `reloadRule` where answered with a KeyError, because
the rule was pruned. When reloading  of a rule failed, because
of a syntax bug in the cps for example, the reloadRule method
was blocked forever.
Fix: false positives in atImport recursion detection

Add test: false positive in atImport recursion detection
FIX: a previous merge removed the invalidation of the recursion detection
Merge pull request #311 from graphicore/fix-atImport-Bugs

Fix at import bugs
components: preserve them over import and export.

make properties of component read only, can remake them read/write if
need be seems some other siblings do this, maybe transforamtion needs
to be read/write. I guess the glyph being referred to will not be able
to change though.

A little sweeping.

Added the getters, turns out that I needed to refresh the non es6 js file too by the looks of things.
Adding CPS parameter for transformation
ufo components: this can now render components again.

But this time it is using the data from the MOM model which includes
the component MOM object. Recursive component references are
supported, for example the reference from 'a' to 'b', in
components.ufo, where 'b' then references 'c'. The drawing of 'a' will
include {a,b,c}.

Transformations are not tested at all yet. So its rather likely that there
are some glitches in that section of the code.

little comment.

fix using wrong variable
render components using the original codepath.

outlineb isn't needed.

more sensible choice of component color(grey with a bit opacity)
tranform through cps works, circ component detect.

So now model.getComputedStyle(penstroke).get('transformation') works and
is used. I have also tested CPS transforms on component renders to see the
componennts move around as I modify the CPS.

Some examples from the CPS file are:
component {
    transformation: (Translation 100 100) * originalTransformation;
}

glyph#b component:i(1) {
    transformation: (Translation 0 0) * originalTransformation;
}

glyph#a component:i(1) {
    transformation: (Translation 0 100) * originalTransformation;
}

There is also basic circular component reference detection on render
now. A message is console.logged (which should move over to using a
_log parameter next). This uses the styledict/finally type code to
detect circular references. I'm still coming up to speed with
generators, so I pass the parameter to use for cycle tracking as arg1
in order to bind it in the caller. A few attempts I made to use a
shared variable in ExportController.es6.js didn't end well. The
current code works though.
moving the place where the components are handled. some initial test stuff.

ok, so somehow that one line got changed in the move over to having the code
in ExportController.prototype.drawGlyphToPointPenGenerator.
cleaned up and ready for the next adventure
change how the addcomponent is patched to the svgpen

fold the monkeypatch into the factory
update ufojs
Add a class to better control the rendering of the glyphs and their components

Simplifiy the logic in ExportController
Bugfix: use the right file name for logging
Merge pull request #312 from graphicore/components-finalize

Components finalize
Smarter approach for getMatchingRules

Also replaced a "if ... or ... or ... " cascade with a switch statement
Compile the stack to a javascript function
Cache the index/position of the MOM Node in its parent.

Instead of linearly seaching for it on every request.
ParameterDict: make an index on first access.

Instead of a search each time.