add requires
improve requires; fix tests
remove \n in __iter__
fix test
fix test
add safe_upgrade