Compiler warning cleanup

No functional changes -- but removed unused code and fixed various warnings, including deprecations and unchecked generic types.