Python 3 support

Small changes to allow Python 2 and Python 3 support through `2to3`.