Add Python 3 support.

Please review! :)
Tested on OS X 10.9 with Python 2.7.5 and 3.3.3.