Move Lesson 9 to isKeyPressed

Lesson 9 now uses isKeyPressed for keyboard event handling.

Also moved to switch/case for other keyboard event handling,
rather than sequentially chained 'if' statements.

Also some formatting changes to lesson 8.