code cleanup
add iterators
add Python C bindings