Added Queue implementation with constant time complexity and HistoryIterator uses it