Fix python3 issues in some examples

Unfortunately these are the easy ones ...

This mostly involves intervals/keys and xrange. For the most part I chose simplicity over minimising memory usage and replaced interkeys etc. with keys. The loops are rather short so the benefits from iterators is rather limited. If anyone thinks it is important I am happy to change this.
Use your judgment; in my view, six should be used as *little* as possible, especially in examples.  It's an ugly but sometimes necessary workaround for 2/3 compatibility.  One would have to have a huge dictionary before there would be any practical difference between items and iteritems, for example.