fixes #88: cleanup code

fixes
* whitespace
* blank lines
* imports
* long lines (mostly)
* mutable default values
* typos
    
adds some comments
    
ignores: tests and copied external libraries (quantities, singleton, bottle)