Preparing to modify the OS.
Changed OS operation to support priorities in threads (ordered by thread index).