Code cleanup - fixed a number of violations caught by lints - several unused imports, some variable shadowing, some whitespace issues.