Consistent Formatting

I made the formatting more consistent:

- two spaces before inline comments and one space after '#'
- removed trailing spaces
- used " instead of ' for docstrings it is recommended by pep8 and pep257 and most people follow this convention
- removed all trailing empty lines except one
- started adding docstrings to reduce number of inline comments