Clean up some 2to3 issues

Generic cleanup from running 2to3 after all the chages and
additions. Mostly they relate to using 'long' as a variable
name (which 2to3 insists on converting to 'int')