Implementation of the fantastic bipbuffer datastructure invented by Simon Cooke. For more details see:
bipbuffers are great because the caller doesn't need to worry about the item falling across the buffer's boundary. Saying that, if you're on a UNIX system it's possible to use mmap to give a normal circular buffer the same ease of use, see: https://github.com/willemt/cbuffer
BSD