Add exit-on-missing-file in lessons 8 9 10 11 12

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

Also renamed various variables/functions, and formatting tweaks all around.