Use python3 style division

Python3 division yields floating point results in all cases by default.
If you want to perform integer division, you need to use the '//'
operator.

In the modified file, the intended operation was a floating point
division anyway.
Use python3 style explicit relative imports

In python3 implicit relative imports are deprecated. Python2.5 supports
python3's explicit relative import syntax only using:

    from __future__ import absolute_import

From python2.6 the syntax is available without this statement.
Fix issue with missing type basestring in python3
Fix pre-existing syntax problem
Fix dictionary compatibility issues

In python3, there is no has_keys() method for dicts anymore. Instead use
the syntax

    "key" in mydict

which is compatible to python2.
Fix binary issues

In python3 byte-arrays and strings are not implicit convertible anymore.
Use .lower() as method instead of statically

str.lower() is not compatible for unicode and normal strings on python2.