Detailed Service Worker registration example.

@jakearchibald @KenjiBaheux

This sample takes things a step further by attempting to illustrate aspects of a Service Worker registration:
- Whether SW is available
- Whether the current page is already controlled by a SW
- Whether the current registration attempt represents the `installing`, `waiting`, or `active` SW
- The state transitions of the SW associated with the current registration

You can view a live demo at https://rawgit.com/jeffposnick/samples/sw-registration-events/service-worker/registration-events/index.html
This might need to be changed slightly if we go for getRegistration first then register if needed.

If I'm not mistaken, depending on the circumstances, there can be one of each (one .installing, one .waiting, one active). For instance, when you register again with an updated script, you'll have installing (new SW) and active (old SW) and then waiting (new SW) and active (old SW).

That being said, checking for installing, waiting and active in that order should give you the most recent SW.

cc/ @jakearchibald : I might be a bit fuzzy here, help appreciated.