Compatible with Python 3. All tests are successful in Python 3.3.3

Merge with origin repository.