Port to Python3

* Change string formatting to ``str.format()``.
* Function and methods not more return ``bytes`` object.
* Templates use only Unix format.