LDEV-1348: Tweaking the hibernate handling of branch activity mappings - can't rely on the cascades to delete unwanted mappings so clear the collection references and delete any unwanted mappings. This is needed when the user changes a branching activity from one type to another (e.g. group based to tool output based).
LDEV-1348: Tweaking the db handling of branch activity mappings. If a user deletes and then readds an identical mapping for grouped based branching, we get a new entry created and the old entry deleted. Can't guarantee what order Hibernate will persist the changes to the db, so e can't have a unique key on group/sequence on the table.
LDEV-1347: Update the validation for branching. Splitting the validation code off into a separate class, to make the LearningDesignService class easier to read.
LDEV-1348: Adding the tool id to the condition, so that conditions can be re-instated automatically in authoring if the user changes a branching activity from tool based to group/teacher chosen and back to tool based. On the server side, the data is redundant at present, so the id is added to the DTO only, and ignored in the extraction code.
LDEV-1348 Switching branching types retains branch mappings but discards when saving design. Added tool activity to tool output condition to enabled pre-selection when returning to Tool based branching type and mappings exist.
LDEV-1366 Fixed onReleaseOutside event for dialog and also problem where dialog could be 'thrown' off the stage, but was unable to reproduce the error where the dialog doesn't initially have focus when dealing with setting up branching