Replaced the deprecated global $NOTIFICATION_HANDLERS variable.

Some functions still use the variable, but those functions will eventually be removed anyway.

Tested and ready for merge.