Convert library to python3.

Also continue adding support for pip/distutils.