Migrating the code to Python 3. (Backward incompatible)

Some mixedCase function-names where renamed to lowercase (separated by
 underscores).
PEP8
minor style changes
minor style