Generalize command-line unit testing machinery

Move machinery for unit testing a command-line program with input and
output files from trajectoryanalysis tests to testutils, and make it a
bit more general.

Existing code using IntegrationTestFixture could be also adapted to use
this (perhaps by making IntegrationTestFixture inherit from
CommandLineTestBase), but that is left for another change.

Change-Id: I3dd9f9667f727be30cf26a6b9d22dd6d44dfef9e