Attempt to make module python 3 compatible
Bit naive but it seems to work.
Fixed up string type issue. Now tested on 2 and 3.