Refactor tracking logic

Separate time tracking logick from Service class.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>