Add a worker that periodically updates the metrics.
Light refactoring.
Merge pull request #15 from eric-wu/master

Add a worker that periodically updates the metrics.