Re-implement SPL RegexIterator and Recursive~.

There are too many bugs in php-src and HHVM, so we re-implement it from
scratch without extending the existing classes.