Implement Unit Tests using pytest.

For discussion, see #41 .

This is not complete yet.

So far, this is not quite as big an improvement as I would have liked. In particular, while the parametric fixtures are quite nice, there is *a lot* of repetition in there that I haven't been able to get rid of.

At least the tests themselves are pretty clean though.

The `write` tests suffer from the fact that the files are opened write-only, and thus there is no way to check whether the data was actually written correctly. This can only be done in read-write mode, which is not implemented yet. The tests for read-write-mode would look rather similar to the write-only tests though, and I haven't figured out how to solve that repetition yet.

Finally, I have not figured out how to test both the functions and the methods at the same time yet.