@julienw after a quick grep, I think it would be better to leave lazily registered `visibilitychange` events back in their own file (Like notify.js and activity_handler.js) and  I will leave the other related logics in `visibilitychange` of message_manager.js  (because it is the main entry point from startup.js)

In this way, we can leave some self-contained stuffs in their own js file and maintain shared ones in message_manager.js 

I will force update commit after adding unit tests. Thankkkkks :thumbsup: