Tests refactoring

Various refactorings to the unit tests as I've been learning the code. Nothing too controversial, I hope. Jenkins is happy with all these commits, although master is still failing because of #36.