refactor reverse_indices to be callable as an independent function
Merge pull request #177 from dimagi/refactor

refactor reverse_indices to be callable as an independent function