Assorted cleanup/modernizations

This addresses some of the issues in this aging codebase. There's still a large
amount of cleanup that should be done to correct unsafe shell constructs (mostly
related to improper quoting).