Initial work towards python 3 support