Eliminate many HLint warnings and a couple GHC warnings

HLint still complains about reducing duplication and test functions named `test_XYZ`, however.