getElemsByClass API for IE8

fixed toArray to work with NodeLists in IE8