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