Added event-based framework for handling connections.