use utils helper macros/functions through the whole lib

* use to_unicode()/to_unicode_n() for creation of unicode strings
* main support switch to python3 instead of python2 (provide defines for python2)