Fix #80

Stupidly forgot to test python 3 with the last release, and of course
the dict.values method change to a generator/view in python 3. This code
should work reasonably efficiently with both py2 and py3