CONTRIB-4186 Calculations to lib, pass them to renderer.

This moves the calculation of totals to locallib,
for later improvements in the way they are shown
by the renderer by diferentiating error/warnings/good.