CB stuff and integration

Fixed circular buffer usage in some tasks, added CB function, nearly
completed scheduler.