change indexInstances to accept InputStream

overloaded indextInstances to accept File or InputStream, to work with
chi test input format