Clear the notifications map when notifications are dismissed.

Uses a broadcast receiver that clears the notifications map when notifications are cleared/swiped away in the notifications area.

Fixes #1481
Thanks, I made that change as well as a few code style tweaks.