A quick hack to work with python 3

Hello,

I just tried to use logstash with python 3 and had a couple of issues.
basestring is not present in python 3 and the import failed.

I have hacked a quick diff together that works but has a couple of "if version is less than x do A else do B" statements.

Thought I would send it your way incase you were interested