Switching to open-isns

Quite a big change, but that's what fate#316901 wanted.
Remove `count` variable and use `list.each_with_index`, see http://ruby-doc.org/core-2.1.2/Enumerable.html#method-i-each_with_index