core: prefix API functions correctly

Also changed names for bitarithm functions and rename thread_pid to sched_active_pid.