Beginnings of async sockets client

Also forced a flush of the message queue when shutting down loggers.