Check page visibility api when sending webkitNotifications

Check page visibility api when sending webkitNotifications. You may have some comments on CS style. I'm happy to change any style stuff you might have. Also wrote it with cross-browser compatibility in mind, because I'm interested in playing around with playing around with [Firefox notifications](https://developer.mozilla.org/en-US/docs/WebAPI/Using_Web_Notifications) and seeing if I can get those working.