Adds hooks for activation and deactivation.