Code refactoring

Some major code refactoring. Specially, splitting class Time into two classes - Time (representing absolute Time, eg: 12:01 AM) and Duration (representing a duration of time, eg: 3 secs)