Move the ringbuffer logic into a separate file
move cpu implementation out of the header file.