ringbuffer: converted to header and lib file

ringbuffer is so short as to be suitable for inlining, but...

removed test and main
test_ringbuffer: start at tests of ringbuffer functionality