Rewrite all socket I/O to use asyncore/asynchat.