Added Python3 support.
The code is runnable with Python3 and Python2 now. Tested with Python 2.7 and Python 3.3.