Updated Python 3 branch and fixed running tests

This is a merge from master (Feb 04 to Mar 19), with additional fixes (from March 22nd)

The tests can now be run (and pass) using tox.