test automation

…and a bunch of other related cleanup (commit messages fairly accurately describe what exactly happened).

This at least sets the precedent for new features to be added with test coverage.

Coverage is not even close to complete for existing functionality, however.

Fixes #61.