RTOS implementation

Not finished yet, there's some issue with things being redefined in the
library header files or something that I'm figuring out, so it doesn't
compile yet.