Refactor duplicate code from TestSet and TrainingSet to Set.
Script to generate duration cache file.
Making duration feature faster by using a cache.
Added test cases for duration feature.