Added test cases for TimeWindow. TimeWindow asynchrony refactored