fixes for py2.6 (importlib) and py3 (iteritems)