Python3 for pull

Some fairly simple changes to bring us closer to python3 support.