many fixes (take 2)

[supercedes #49 (which apparently can't be re-opened since I force-pushed `master`)]

Many changes, including:

* fix several bugs introduced by Python rewrite
* add tests for `changesgenerate` functionality
* apply PEP8 to tests, not just `tar_scm.py`