Faster version of BatString.(n)replace

This version of 'replace' only allocates a single string. On short
strings it takes 60% of the time of the old version. Perhaps most the
time is spent in 'find'.
Fix: nreplace shouldn't proceed from right to left

The buffer based version of nreplace failed to comply with
the documentation that nreplace should replace from right to
left. Since I can't think of a way to fix this elegantly while
keeping the speed improvement brought by previous commit, I
changed the doc instead, which may break some code.

If retrocompatibility on such issue is deemed important, then
we may add an additional parameter to choose direction, or at
least provide a nreplace_rev so that code relying on former
behavior can easily be adapted?
fix: make bench broken by composition operator renaming
restore direction of nreplace (right to left), slower implementation
add BatSubstring.unsafe_substring injection function for performance reasons
(cherry picked from commit 785af254da3d06271df0946002b9f7e653aaec51)
Add all proposed implementations of nreplace in bench_nreplace.

We try to bench these against a realistic workload composed of lines
of various length from a few chars up to 5k chars, exercising all
possible cases (short sub, long sub, not found, frequent subs, no sub...)

Gasche implementations seam to win hands down.
Minor trick to gain an allocation
Test the various contender for simple inputs ; comment out enum version

Sorry I probably introduced a bug somewhere. WIP.
add adaptive algorithm to bench_nreplace

-add horspool substring matching algorithm for large patterns
-add nreplace_thelema_adaptive,
 which will use naive find for small patters/texts,
 and horspool find for large patterns/texts.
(cherry picked from commit bbf211de6a18a2b0006c8e6634f6c98022d7bbc7)

Conflicts:
	benchsuite/bench_string.ml
fix (?) gasche enum version
Merge remote-tracking branch 'rixed/string_replace' into string_replace_optim

Conflicts:
	benchsuite/bench_nreplace.ml
bench_n instead of bench_fun for nreplace