Initializing engine event handlers and resource management.