Feature/time abstraction

Hi, this is the cleaned up version of the time abstraction. As I mentioned before, it makes no change to the code size, but makes the code more flexible so we can implement automated testing.