Update registration algorithm.

* Resolve promise after successful worker script evaluation, before install.
* Fire installend event after install process.