Bring shadow dom algorithms up to date

This is a complete update of the distribution, composition and event
path algorithms from the spec draft.

Fixes #420
Add workaround for IE11 crash
Merge pull request #423 from arv/new-shadow-dom

Bring shadow dom algorithms up to date