Update next, hasNext, each and toArray

@mglukhovsky would you mind taking a look at these changes?