Circular buffer & scheduler

Made a circular buffer library and made a start at the scheduler.