Implented correct async write loop

Also implemented a multi-threaded EndpointBuffer, although I no longer
need it.
added benchmark