Detect whether tab is active using visibility API. A boolean called 'isActive' sits in the application namespace
Fixed a bug with unread messages not being marked as read