Mostly working kqueue implementation. Missing timers and signal handling still.