- Removed lots of unused variables, a few shadowed identifiers. - Removed a few sections of dead code.
Formatting rules based on Paul Kulchenko's perl-based formatter... http://notebook.kulchenko.com/programming/lua-beautifier-in-55-lines-of-perl ...using a single tab for indent. Mostly pure whitespace changes.