refactored triggers into general purpose hook system for events, commands, and triggers