Added ringbuffer class.
Added max_size check to ringbuffer.
Added correct handling of 0 size ringbuffer.