sched_switch()
There is no need to supply the current priority to `sched_switch()`, when this function can easily tell the value of `active_thread->priority` itself.
Also changed names for bitarithm functions and rename thread_pid to sched_active_pid.