Simple FIFO circular buffer imlpementation.