Cycle detection appears to work - there are possible optimisations;
there's no point in cycle detection iterating over keys for lists and
ranges. Or in fact ranges at all.

Also, we now have a mechanism for creating key iterators which is not
accessible from the code - consider an "eachkey" word.