Codequality, PEP8 cleanup

As we did before releasing 0.7.2 we could take the opportunity to clean up the code base before 0.7.3. I checked this manually and unmade any undesired changes introduced by the script.

```
# pep8 clean up with a modified copy of pep8.py that allows
# whitespace after ':' and arbitrary spacing around '*', '**', '/', and '//'.
autopep8.py -i -r --ignore=E124,E128,E201,E202,E261,E302,E501 sympy
```

Here's a list of ignored rules:

E124 closing bracket does not match visual indentation
E128 continuation line under-indented for visual indent
E201 whitespace after '(', '[', and '{'
E202 whitespace before '}', ']', and ')'
E261 expected at least two spaces before inline comment
E302 expected two blank lines between def blocks
E501 line too long