Clean up the JavaScript example

This brings the example much closer to current discussions. This does not yet take into account the idea of moving pushRegistrationManager to ServiceWorkerRegistration as I think Peter had some questions about that.