Add tests for files with append mode

Here's a start. This is going to be a long test by the time we've finished with it!