A template for a simple circular buffer. Always assumes that the buffer is full, and allows for negative indices and indices greater than buffer size.