pep8 fixes
Clean un-used imports
Replace the map() function by a list comprehension - makes pylint happy(ier)
More pylint fixes

- remove un-used arguments in function call
- remove un-used code
- add function documentation
- adjust unit-test to changes in the function call
Rename local variables to avoid re-using variables already used by functions