Bug 866733 - Replace 'for each (v in iterable)' loops

Replace deprecated 'for each (v in iterable)' syntax
with 'for (v of iterable)'

There are several remaining uses of 'for each' which
iterate over objects that are not iterables.
Merge pull request #1557 from robertknight/866733-replace_for_each_loops

fix Bug 866733 - Replace 'for each (v in iterable)' loops r=@ZER0