Time handling has been rewritten, and some minor design improvements were made.