MBS-7177: Selecting a rel then another in the relationship editor causes a weird mixup

The current dialog code is very fragile because there's actually only
a single dialog instance on the page. So whenever the target
relationship changes, we have to reconfigure all the internal variables
of that single instance to match what was clicked on. This requires
a good number of hacks to deal with, and makes the code hard to reason
about in general.

There's no reason it has to be that way, though, so this changes it.
Dialog instances are now disposable, so whenever the user clicks on a
different relationship, we just create a new one and throw out the old
one. This is much easier to comprehend.

This solution resolves a number of issues where clicking on a
relationship while a dialog is already open for a different one
produces weird results.

I tested the changes locally by submitting different types of edits
(adding, editing, removing relationships with different attributes)
and using all the batch-editing tools. I also fixed the unit tests and
made sure those all pass, too.
Merge branch 'beta' into mbs-7177

Conflicts:
	root/static/scripts/tests/RelationshipEditor.js
Merge remote-tracking branch 'bitmap/mbs-7177' into beta

* bitmap/mbs-7177:
  MBS-7177: Selecting a rel then another in the relationship editor causes a weird mixup