Changes for Python 3 and linux compatibility

Hi,

I've made a few changes to consider to make this compatible with python 3 and linux. With this, it should still work the same under python2 and windows (I just checked on my machine). I haven't gotten it to work fully with linux; but that has to do with the FTDI driver and linux. You can read about my woes here: https://bbs.archlinux.org/viewtopic.php?pid=1427908#p1427908