Cleaning up RecursiveTreeIterator class

- Cleaning up the code
- Making it PSR1/2 compatible