Fix for message-passing style event handling.

Needed to decouple the event handler and the actual file data sending.