modifications for better utf-8 handleling

modification uses better sanitization of the input
from __future__ import unicode_literals
adding a test for the output type
some core modifications and cleaning (no more str() on a string
in the middle of the code)
adding some examples