Sorts the given array of
resolved bundles in pre-requisite order. If A requires B, A appears after B. Fragments will appear after all of their hosts. Constraints contributed by fragments will be treated as if contributed by theirs hosts, affecting their position. This is true even if the fragment does not appear in the given bundle array.
Unresolved bundles are ignored.
@param toSort an array of bundles to be sorted
@return any cycles found