Fixed compiler warnings.
Added mem check for internal buffer.
Added example program to show how to use circular_buffer.
Added unit test for multithreading; does not pass yet.