Rewrite strip_dict to work on Python 2.6

Dictionary comprehensions only appeared in Python 2.7