Allow to attach attributes to iterations

 - modified read/writeAttribute
 - added test in AttributesTest