Moved printing of statistics to a separate module.