More fixes for !68913: hasFlag and iterators
I found a few more things that were broken by !68913 (merged): hasFlag
wasn't being redirected to the renamed flags, and the iterators weren't working properly in the renamed case. This should fix both of those.
@tbold this adds a few more unit tests as well. There might be a few more issues lurking but this is looking pretty good.