Until now, the "set" functions generated by the IDL updated the data in the
database (during commit) but not the data exposed by the IDL in its data
structures. This was just an oversight, so this commit causes the data
exposed by IDL to be updated also.
Our tests only checked references from a table to itself, so of course
there were bugs in references from one table to another. This fixes the
obvious one and adds a test.