In core.socket change reads from sockets from a nonblocking method to
an event that fires when data is available. Likewise change accept
to an event that fires when there is an incoming connection.