Testing improvements and better Python 3.x support