Remove unused imports, commented out unused variables, cleaned up compil...

...er warnings. No change to functionality.