Merge pull request #21 from kdopen/add_iterator

Add new iterator implementation and some NULL-pointer safety