Implement a proper thread ready queue

Fixes:
 * Lunar
 * Patchwork Heroes

Hurray.  I also included a couple minor tweaks:
 * Indexes by priority so that thread switching is much faster.
 * Fixes vblank resched on disabled interrupts (broke alarm test.)
 * Kills idle -> idle logging.

Couldn't find anything this broke, but it's very likely to break things...

-[Unknown]