Fixes #393.


The real problem turned out to just one one missing line of code.  But while I was at it, I also refactored the ampersand-encoding of dangerous characters in the persistence file, which was a fix I made on the way to trying to discover the problem, because I was barking up the wrong tree at first.  But I'm reluctant to remove the change because I think the new way is superior to the old, even if it wasn't the cause of the problem.

The new ampersand-encoding system made the following change:

Old way: (a blacklist):  Assume all characters are safe to write out raw except for those which are explicitly mentioned.  Create an ad-hoc encoding that hardcodes the ampersand escape for each exception case.

New way: (a whitelist): Assume all characters are UNsafe to write out raw except for those which are explicitly mentioned.  For anything not white-listed, create a generic encoding system that works for any arbitrary character.  (It's always the HTML ampersand escape "&#____;" where the ____ is the decimal integer ordinal of the character in whatever character encoding (unicode in this case) is being used.)

Why the new way is better: With the blacklist, the consequence of forgetting to mention a character that belonged on the list is corrupted files, broken saves, etc.  But with the whitelist, the consequence of forgetting to mention a character that belonged on the list is that it still works, but there's merely a bit of unnecessary work converting into and out of the encoding.