Add --all-times and --avg-time options for timing tests

These options control whether to print each run of a test individually,
to print just the average of all of them, or both.  If neither is specified,
both are assumed.
Also fixed bugs in the Timer class, in which it did not always heed the
report_all_times and report_avg flags.  This behavior has been fixed with
appropriate if-statements.