Initial python 3.x commit with 2to3. Untested.
PEP8-ed and fixed additional python 3.x issues.