Dynamic loading of test modules, Calculating term frequency in a list of document tokens