Merged Python3 to Python2 branch

Merged Python3 to master. Using compat.py to get habe both versions in one branch.
Pep8 with autopep8
Fixed a error PluginManger. issubclass can also throw other Exceptions than TypeError.