First pass on python 3 support