Added a few time-related functions for future use, as well as some tests.