dtoc: Use items() to iterate over dictionaries in python 3.x