Fix string .join() for Python 3.
Fix missed swig wrapper rebasing.
Whitespace fixes in comments.
Python 3: fix dict .keys() usage.
Python 3: fix manual generator consuming