Basic Python 3 support

Hi,

A few changes to make this widget py3 compatible.