Update registration algorithm.
Update registration algorithm.

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

justinleoye/ServiceWorker,chadoliver/ServiceWorker,martinthomson/ServiceWorker,slightlyoff/ServiceWorker,karolklp/ServiceWorker,justinleoye/ServiceWorker,mkruisselbrink/ServiceWorker,chadoliver/ServiceWorker,karolklp/ServiceWorker,karolklp/ServiceWorker,justinleoye/ServiceWorker,zuzusik/ServiceWorker,martinthomson/ServiceWorker,martinthomson/ServiceWorker,chadoliver/ServiceWorker,zuzusik/ServiceWorker,zuzusik/ServiceWorker,mkruisselbrink/ServiceWorker,slightlyoff/ServiceWorker