Optimize memory footprint of statistic compilation

The statistic compilation was too memory hungry. The resource numbers
are now generated on the fly when importing the data.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Optimize metadata retrieval regarding memory

I have updated all the worker classes to use the memory efficient method
for accessing the metadata records. Instead of successively loading each
document into memory, the document gets garbage collected.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>