rename "index" to "indexof"
fix jshint warnings