Add Python 3 compatibility. 3.1, 3.2, and 3.3 all work.