Replaced tabs with spaces and removed usage of several deprecated features:

* dict.has_key -> `in` operator
* backticks -> repr

Also removed trailing newlines from a few files.

flake8 --select='W' no longer reports any issues
Merge pull request #12 from alex/flake8-w

Replaced tabs with spaces and removed usage of several deprecated features: