Unit tests, suitable for running with pytest.

These tests can be automated and run with continuous integration. They should
cover at least the most crucial bits. Some things, however, are tested
mainly via scripts (in the scripts directory).
