Improved and implemented toArray
Improved and implemented toArray

The previous naive implementation of toArray would not work in IE, so a
manual iteration function is added. Everywhere where slice used to be
called, we now use toArray.

avdgaag/mutil,avdgaag/mutil