NotificationsManager fixes.

Recognition wheter application is in background is now improved using
ApplicationObject.