Added a reference for split() tests.
Finished replace() (now it accepts a function).
Optimized calling RE2::Match().

We check the upper limit of submatches in a replacer string,
and number of groups in a regular expression, then allocate
the minimally possible number of groups.