Lots of code cleanup. Removed unused imports, empty catch blocks, etc.
Also fixes 2 UTF-8 incompatible files.