IOLoop refactor

- Add KQueue and Poll to provide faster polling than select, falling back to select
- Change how writing to the socket is handled, addressing #37