Add client event handler

This completes https://github.com/jcelliott/turnpike/issues/2.