Switched to using a semaphore for simplicity.
Better handling of minimum buffer size.
Moved fifo into separate lib
Added testing for c libraries