Inline named functions, rename variables, tidy.

Tidy the code by removing two named functions that can be as easily
expressed inline, renaming the `test` variable to `predicate` and some
other odds and ends.
Merge branch `tidy` into `master`.