Handle tool and pipeline input parsing from JSON where strings can be str or unicode: compare against basestring instance instead of just str