Add tox config, simplify tests, add CLI tests.