Finally seem to have fixed problems with tracking of unsaved changes.  Added a new proc to ensure that both the modified flag of the text widget and the ::unsaved variable are updated.  There is one situation where only the ::unsaved variable needs to be changed (in the low-level "load" command), but all other use cases should update both in sync.