Moved stack and queue to abstract iterator