Cleaned up countdown code, preparing for timestamping.
Added event logging (badly).