use dict.items() to make stuff work on py3k

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>