Fluid-5026: Fixed scheme for outputting to document according to JIRA description

DEPENDS ON https://github.com/fluid-project/infusion/pull/384 and https://github.com/fluid-project/infusion/pull/383

Model transformation framework should now do the outputting according to the rules described in the JIRA. A nice side-effect of the work (at least what I've been able to tell when stepping through functions) is that duplicate entries in the queuedChanges no longer happens. This pull request contains the two mentioned above and should be reviewed after those