Changed desktop notifications to support Firefox.

Pretty much everything of the notification handling was redone.
This is tested on Chromium version '32.0.1700.107 (248368)' and
Firefox version 29 and 27 under linux. More testing would be nice.

PS: This is pretty much my first ever work in JavaScript. I hope what I've written is good code, and I'm open to constructive criticism.