fixes for setuptools, Python 2/3 compatibility and tests