Add Python 3.4 support (and fix some Python 2.6 problems).