Don't rely on str, use six.string_types instead

Fixes #43, thanks dcwatson!