Refactor tests

* Use pytest syntax to reduce boilerplate
* Move testcase tests into testcases directory

Depends on #26, so will be easier to review when that is merged.
What's the reasoning behind this change?  We use `self.assertEqual` et al. everywhere.