Fixes for python 3

Hi I fixed some issues that prevented sqltap from working with python3. I used the "python3 first" approach, but this might be a matter of taste :)