Massive refactor. Extracted state management and preference reading from EventListener into separate functions. Combined ApplicationCommand listeners, using an 'enable' argument instead of inheritance.