sequences: More efficient longest and shortest by moving infimum-by/supremum-by into core.