Remove some system time dependencies

Either remove the use of the clock altogether where it was
unnecessary, or refactor things to use a Clock interface
for controlling time.