Significantly improved memory efficiency.

First, added several diagnostic memory footprint calculations. Then, observed that the major source of the memory consumption is caching of the removed duplicated item instances, which are recorded in the transaction objects. Stopped caching and instead recalculated removed duplicated instances whenever frequency has to be computed (note that frequency is cached, so computing it does not happen often). As a result, memory consumption dropped very much.