Fixes to get for python3 virtualenvs working

I've been happily using powerline-shell on OSX for quite some time now. Thanks for building it.

I created a Python 3.4 virtualenv using Python3's builtin pyvenv command and powerline-shell would break anytime I activate it, powerline-shell would barf out. I decided to spend some time making things cross compatible between python2 (>= 2.6) and python3. It turned out to be far easier than I'd anticipated it to be.

I've been using this patched version for the past couple of days with Python 2.7 and Python 3.4.  I found that this issue had been reported earlier on #118, but I couldn't find a way to attach a pull request against that issue. I've also got another branch with a few pep8 fixes on top of this, but that should probably be addressed separately.