feature(analytics): track performance of state changes

This tracks the number of milliseconds between $stateChangeStart
and either $stateChangeSuccess or $stateChangeError.

Fixes #19