correctly implement IFn for indexes through a wrapper

this provides a fix for the behavior noted in aphyr/riemann#318