Code tidying: moved adding of epoll event handlers closer to the handling code.