NOTE: The existing alerts configuration of the users will be discarded.
Some code has been added to make the current gui on/off toggle work.
It is marked with the following comment:
-- TODO remove after implementing the new gui
Now periodic callbacks are properly called even when alerts are disabled
The granularity filter and check_function has been replaced with a more generic hooks list