Added PlugLayout.layoutOrder() static method.
Fixed UI reordering bug in UIEditor.

The sequence of operations went something like this :

- Add plugs A, B, C
- UIEditor assigns indices A:0, B:1, C:2
- Delete B
- Add a new plug D
- UIEditor assigns indices A:0, C:2, D:2
	- Keeping the existing indices for A and C
	- Assigning D an index based on its position in the parent
- C and D are now stuck together, and follow each other whenever dragged in the UI editor

The fix uses PlugLayout.layoutOrder(), sharing the ordering code rather than duplicating it, and then assigns unique indices based on this order. This not only prevents the problem above occurring in the future, but also unsticks any existing stuck plugs.

Many thanks to @louisdaniel for finding the steps to reproduce this one.

Fixes #847.
Merge pull request #1093 from johnhaddon/uiOrderBugFix

UIEditor plug ordering fix