Replace write queue with a circular buffer

And allocate some struct members statically
Try sending the data straight away