3.0 collection unfold

Another common pattern that I found myself using constantly is concatenating the items from a collection containing multiple other collections. This pattern is known in functional programming as "unfolding" or "anamorphism".

It allows creating a collection containing all items from the internal collections. For example iterating with a single object the lines from different files sequentially.

This includes the commits from https://github.com/cakephp/cakephp/pull/5444 because I'm lazy and because I expected that one to be merged before this one would be ready.
I just moved this code to another place, we could discuss it in another ticket. My opinion is mixed, since the case I had in mind originally was matching date objects, so triple equals would fail in that case.