Changed Range_ensureValidHierarchy() to move backwards through the list of nodes, instead of forwards. This effectively changes the algorithm's behaviour from O(n^2) to O(n) in the case where all elements in the list have to be moved outside their parent.
Changed Range_ensureValidHierarchy() to move backwards through the list of nodes, instead
of forwards. This effectively changes the algorithm's behaviour from O(n^2) to O(n) in
the case where all elements in the list have to be moved outside their parent.

Moving forward was causing the problem where if you pasted a sequence of paragraphs
inside an existing paragraph, then it work through the list, and for each paragraph, move
every following paragraph into a new parent - thus the O(n^2) behaviour. By moving
backwards, the call to Formatting_moveFollowing() instide Hierarchy_ensureValidHierarchy()
only moves one node at a time, so overall the algorithm becomes O(n).

corinthia/corinthia-editorlib,corinthia/corinthia-editorlib,corinthia/corinthia-editorlib,corinthia/corinthia-editor,corinthia/corinthia-editor,corinthia/corinthia-editor,corinthia/corinthia-editorlib,corinthia/corinthia-editor,corinthia/corinthia-editorlib,corinthia/corinthia-editor