issue #22244: refactor document associations

Not ready for pull yet

TODO: need a compound inverse in case of duplicate source key

resolves #1962.
Now instead of having a toMany for each type of association, there's just one toMany property called `documents`