Move format_time into a separate file.

This will allow it to be used by SessionFormatter when that is in a
separate file too.
Move the SessionFormatter into a separate file.