In IE8 there is not an indexOf function on the Array.prototype. To

combat this, define an indexOf function that defers to the native
version if possible, then falls back to a naiive implementation.