Switch String.indexOf and isArray to new polyfills

Also fix String.contains polyfill.
Fix resource cache argument positioning