Fix incorrect handling of nested paths when generating string files
Clean up write_all_files.

We now ignore the current directory and its parent as neither of these
are meant to be checked in write_all_files. This could cause extra files
to be written unexpectedly.