Add Python 3 support.

Implement #6.