Add `_getItemIndexToLayOut` to allow subclasses to pick the next element...

... to lay out by themselves.

This allows masonry or similar plugins to implement a custom "element picking" strategy, where they can decide if they want to use an element further into the array of items instead of the default "next" element.

The default behavior is the same as previous versions and should be backwards compatible. As we create a local copy of items that acts as a queue, there might be a slight overhead compared with a single assignment.