Remove unused #define.
Add Task::priority and always run runnable tasks with smaller priority values first.
Merge PR #682.