Remove all uses of Array.indexOf

For IE8 compatability