Add preemptive multitasking.
Add sleep implementation.