rework test infra. Fixes #22. Ref #6.