Add support for python3

Python3 dict.items returns a View object that does not have the
/sort/-method.

The typenames from the /types/ module do not exist in python3 anymore.