Be more robust with elapsed time counter
Stress testing identified a rare startup race if a user connected
before the elapsed time counter was initialized. The odds of
encountering this in the wild are close to nonexistent, but it was
introducing occasional test failures.
Solve the race by reordering the actions taken on each pulse, so
that the counter is initialized before the listening socket is
created. Also force all access to the counter through setter/getter
methods and wrap in try/except to always return a value and properly
create the counter and containing element if it doesn't yet exist.