sched: revamp of the task init code