Python 3-compatible checking for unicode

The patch below adds support for Python 3 to the ObjectPath shell by detecting what string type the current Python version uses.