fix infinite recursion on case hierarchy generation + test

http://manage.dimagi.com/default.asp?124211
did you mean to change this from `reverse_indices` to `indices`? https://github.com/dimagi/casexml/pull/237