Make ServiceWorker an EventTarget and dispatch statechange to it.

Some infelicities with the event when reusing a service worker, and
unregistering service workers, are noted in FIXMEs in the test. Those
fixes must come later.

BUG=363413
R=kinuko@chromium.org

Review URL: https://codereview.chromium.org/236823002

git-svn-id: svn://svn.chromium.org/blink/trunk@171525 bbb929c8-8fbe-4397-9dbb-9b2b20218538