Refactor: python, cts: Add a Timer class with a context manager.
This can be used anywhere we set_timer, do something, log_timer. It
can't really be used where we return midway through on failure because
in those cases we don't want to log anything.
Additionally, change the timer-related functions in CTSTest to handle
the new type and make the timers dict private.