Fixed compilation on OS X, reduced code duplication in tests by moving timers into helpers.h