Fixes #587. Notifiy when node is down for too long.

* Update notification NodeNotAvailable.
* Update offline time to 5 days.
* Handle flapping states.
Add support to configure notifications expiration.

You can define the period while a delivered notification
remains valid. After that, notification becomes expired
and new emails could be sent.
Group notifications by set_state.
Cosmetic changes to offline nodes notification (#587).
Merge branch 'master' into bug587
Merge branch 'bug587'