Refactor and test utc time functions.