issue #22244: refactor document associations

Not ready for pull yet

TODO: need a compound inverse in case of duplicate source key

resolves #1962.
I agree that there's a namespace concern here, but these strings -- "INCDT", "T", etc -- are strings in the database and are probably hard-coded into the Qt client. I can't really "fix" them here, even the code for quote, which is not `Q` but `Qquhead_id`.

Offhand I don't think there would be a problem with having multiple keys map to the same business object. It would be silly but I think it would work.