improve compatibility for python 3

- make TransformerIterator iterable
- remove comparison "None > 0"
- use six.text_type instead of unicode