index: remove `opts` option logic

This argument is not uses so meh. Also rename the `fn` variable
since to me that implies that it's a Function instance, but in this
case it's a String.
index: add JSDoc comments
index: remove console.error() comment code
index: fix error message
index: add JSDoc comments