Make ObjectGraph(iterator) safe; don't use .values, .items, .keys

In preparation for updating code to work with Python 3:  don't use dict.values, dict.keys, dict.items anywhere;  use the dict.iter* variants instead.

Also make it safe to create an `ObjectGraph` from an iteration;  the previous code for the `ObjectGraph` constructor needlessly iterated through its input twice.