Python3

Port to python3 with 2to3, fix for imports under python3 and additional dict fix.

this version is incompabile to python 2.