Fix a bunch of potential Python 2/3 compatibility problems

As discussed in conda/conda-recipes#91, there are some issues with using `conda-build` in Python 3 that prevent some packages from building properly. I've gone through and fixed any 2/3 compatibility issues I could find. Mostly this included switching to using the `unicode_literals` future, `io.open`, and make encoding handling more explicit.

I also had to change how the distutils patching was done in `pypi.py` so that that happens in a subprocess to accommodate the additional future imports from influencing running `setup.py`.