Address code review comments.

In particular, add multi-path tests.

Also added a TODO to support multiple files with the same content
but different file permissions.

Also fix a few places where I (by which I mean PyCharm) noticed
that I was writing unicode objects directly to files. This was only
in tests, so it didn't actually matter, but still.