Porting to Python 3

Changes to urllib conventions