Use an environment for the tests, not a command

This is much more the 'LaTeX way', and makes it easier to deal with
expandable testing. Presumably this will in the end get hidden inside the
scripts in any case, but it makes sense to use 'good style' in coding
everything.