Inject time as a dependency for SortedMessageQueue

This allows us to write tests around the expected times that logs
are read from the queue much more easily.