Fix for string comparison with future unicode literals

When using from __future__ import unicode_literals in python 2.7,
the call to the namespace() method would fail due to the isinstance/str
check.

A is_str() function was added to the utils module, allowing for a
python 2 and python 3 compatible string check.
A unit test for this case was added.