Fix index test

Fixes #362 and replaces Model.getIterator() iterators with Model.listNamedEntities() iterables.