Switch type of task map in TaskScheduler from HashMap to TreeMap.
This implementation of the map interface returns entries sorted by their
key in ascending order. This way we only need to iterate over the values
until the execution time (key) is greater than the current time, thus
cutting down on execution time.