Solidify iterable iteration.

Casting to Object[] will throw when a primitive array is used. Use the utilities provided by Array to iterate in a type-safe way.
Merge pull request #396 from square/jw/primitive-array-iteration

Solidify iterable iteration.