Implemented custom rules.

Custom rules are rules that can be activated and deactivated by an action.
Implemented custom triggers.

Like custom rules, custom triggers are triggers that can be activated and deactivated by an action.