refactor(ScopeStats): ScopeStats collects information about digest,
flush and assert flush phases.

ScopeStats collects information about all phases and uses
ScopeStatsEmitter to output the results. Scope stats can be started and
stopped at runtime.

Closes #791