Fix for py2/3 compatibility with iteritems/items.

Now use items() instead of iteritems() to iterate over kwargs dictionary.

While iteritems is better in Python 2 performance wise we are iterating
over kwargs which shouldn't be large dictionaries anyway. Therefore
Python 3 compatibility would be better than worrying about the
performance implications.

(Python 3 items method is like Python 2's iteritems, so Python 3 won't
have performance problems).