Move _NameExpansionIterator iteration doc under __iter__ func
Moved bulk of code out of cp.py, to be shared by upcoming sync command