Factor out some common code in time_command() in timeall
Significant refactoring of timeall to support time-scaled tests