Wip/fix 243 session saving
@phil-s This is intended to fix https://github.com/alphapapa/ement.el/issues/243. A few unrelated changes are in here, which I intend to split out before merging. But to fix the bug required more extensive changes than I...well, I kind of knew it would require a lot of minor changes, which is why I've put it off for so long.
Anyway, it seems to work now, tested in a clean config with multiple accounts. Would you mind giving the patch a quick visual inspection and letting me know if anything stands out as wrong? I'm not asking you to test it. :)
Can do, but probably not before the end of next week, if that's ok. I've lisped a bit more than I should have today already, and the next few days aren't going to be an option.