master: Refactor chunks.cc

This commit partially refactors chunks.cc file, eg. in order to:
* use ChunkGoalCounters when calculating goal of a chunk
* make chunk statistics easier to maintain

Change-Id: I6cc95fa725486261202272ae51c7a9c88b6cde81