Rewrite RecursiveIteratorIterator

This is heavily based on php/ext/spl/spl_iterator.c, expecially spl_recursive_it_move_forward_ex

Added a test case that fails on the old implementation