Assign IDs to cells during ID iteration

This is helpful, if the generating script has to know about the IDs assigned to
particular cells. Fixes issue #35.