core: Unroll the loop in the slice iterator search methods
Introduce a helper method .search_while() that generalizes internal
iteration (Iterator's all, find, position, fold and so on).
The compiler does not unroll loops with conditional exits; we can do
this manually instead to improve the performance of for example
Iterator::find and Iterator::position when used on the slice iterators.
The unrolling is patterned on libstdc++'s implementation of std::find_if.