Move raising of errors on missing binaries into util.which where
appropriate.

Less code, and should prevent the kind of copy/paste errors fixed by the
previous commit.
Use decorator for test environment find_* functions, rather than
copy-paste code between them.

Another change to avoid copy-paste errors.
Use deepcopy when defining test environment, fix wrong variable name assignment.