Rename time functions.
Make State a subclass of namedtuple.