Priority scheduling

I separated out the setpriority(2) change into its own pull request.