Added Python3 support
Rewrapped a few lines

So this is my first attempt to port something to python3 :)
Merge pull request #3 from sh4nks/master

Added Python3 support