Refactor tests

Closes #25