[ADD] Adds python3+ support and some code cleaning

Open Gabriel Davini requested to merge py3 into iod

@skennedy let me know if I broke something, hope it helps!

Merge request reports