Made .py files Python3-compatible

Checked and modified .py files in python folder to make them runnable with Python3 (checked with Python 3.2.3).
Note that the plugin still requires python2.7 for it to work correctly.