Clean up use of xref-entry "dirty" flag in file.go and add a file-level "dirty" flag.