some cleanups

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