Clean up transaction relationship book-keeping

This is in the same vein as my previous transaction PR. Currently, we track relationships on both the store and the transaction. With this PR we only track on the store and compute the changes during transaction commit.

This PR is also important to allow moving dirty records between transactions. Currently this is allowed, but the relationship changes are left in the old transaction.