container/iterator improvements + small changes

5f3a637 r=huonw
934a5eb r=thestinger
0f6e90a r=cmr