Gives an error if entities aren't distinct.
Disabled the Change Direction button for errors.
Added validateEntities flag to selectively disable entity equality checks.
Added missing function parameter.
Fixed badly copied and pasted code.
Corrected setting of validateEntities.
Fixed batch add issues where an entity self-links.
Patch from bitmap, fixing batch add.
Undid most of last 2 commits - will be fixed by bitmap at a later date.
Readded validateEntities flag reset after callback.
Fixed conflict in Dialog.js.
Merge remote-tracking branch 'lordsputnik/mbs-5388-clean' into beta

* lordsputnik/mbs-5388-clean:
  Readded validateEntities flag reset after callback.
  Undid most of last 2 commits - will be fixed by bitmap at a later date.
  Patch from bitmap, fixing batch add.
  Fixed batch add issues where an entity self-links.
  Corrected setting of validateEntities.
  Fixed badly copied and pasted code.
  Added missing function parameter.
  Added validateEntities flag to selectively disable entity equality checks.
  Disabled the Change Direction button for errors.
  Gives an error if entities aren't distinct.