Remove unused imports
Delete temp files when done
Make MemoryDiff serializable
writeReplace for FileDiff and FilePatch that converts them to MemoryDiff
and MemoryPatch