Cleanup

Removed unused imports
Added utf8 encoding
Replaced tabs by 4 spaces 
Made some other code cleanups referring to pep8
(Please see http://www.python.org/dev/peps/pep-0008/ for further code
work)