Fix bug 33

Improving code compliance according to PEP 8. The following task are covered:

- [x]      E501 line too long
- [x]      E302 expected 2 blank lines, found 1
- [x]      W291 trailing whitespace
- [x]      W391 blank line at end of file
- [x]      E128 continuation line under-indented for visual indent
- [x]      F401 imported but unused
- [x]      F403 unable to detect undefined names
- [x]      E127 continuation line over-indented for visual indent
- [x]      E231 missing whitespace after ':'
- [x]      W601 .has_key() is deprecated, use 'in'
- [x]      E251 unexpected spaces around keyword / parameter equals
- [x]      E303 too many blank lines (2)
- [x]      E126 continuation line over-indented for hanging indent
- [x]      W293 blank line contains whitespace
- [x]      E301 expected 1 blank line, found 0
- [x]      E261 at least two spaces before inline comment
- [x]      E711 comparison to None should be 'if cond is not None:'
- [x]      E203 whitespace before ':'
- [x]      E701 multiple statements on one line (colon)
- [x]      E225 missing whitespace around operator
- [x]       F999 syntax error in doctest