Increase stack size to 256 bytes; set heap size to 0
Significantly reduce key polling overhead by polling keys in ISR, only waking up main thread if they have changed.
Some minor cleanup.