Refactored metric tracker. Mostly implemented basic metrics.