Uses py3 collections.UserDict if possible

Uses Python 3.x `collections.UserDict` in place of Python 2.x `UserDict.UserDict` if possible.