kernel: preemptive and cooperative scheduler refactoring.