Began implementation of a threadsafe ringbuffer

Writing does not work as of this commit, and code does not compile.