normalized each() function

Normalized the each function, so we now can iterate through array,
object and function.