refactored implementtion of IndexedCorpus, less memory intensive (bit slower),
planning to use as reverse index