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.