Update Python 3 compatibility after merge with develop

Also, change test script from xcb to xcffib.