Correct arguments for 'replaceWith' callback

This should resolve #409

Commit message:

> Ensure that when `replaceWith` is invoked with a function, that function
> is invoked with both the iteration index *and* element.