Bug 970879 - Prevent redundant listeners from being registered during testing r=julienw

- Refactored the WapPushManager object to not use bound functions for
  event listeners
- Modified the unit-tests to improve control over the document visibility
Merge pull request #16208 from gabrielesvelto/bug-970879-prevent-redundant-listeners

Bug 970879 - Prevent redundant listeners from being registered during testing r=julienw