Added MongoDB integration for event storage