Use setuptools if available and Python 3/test fixes

To support fixing issue #1.