Update Notify.needsPermission to false after the user approves permissio...

...n to send notifications

We are building a single page app. In our code we have a check for Notify.needsPermission before we create a new Notify object. When the end user allows notifications Notify.needsPermission remains true until the next page refresh. Since we are building a SPA it could be a while until that happens.

This pull request is to update Notify.needsPermission to false when permission is granted, and the corresponding unit test. Thanks. Any feedback on how to achieve this in a different way is of course welcome.