Implement reading from sockets

This is now all a big ugly hack because libuv is terrible at ownership
and its documentation is even more terrible.

I'll fix this mess later.