Wrap up first round of automated code clean-up

The project should now be mostly purged of unused variables, save for a
few placeholders still to be dealt with before 6.4's release.

Still need to deal with some dead functions and other automated
clean-up, but nice to have this done.