pep8 compliance whitespace changes
monkeypatch cleanup
replaced a direct environment querying
cleaned up imports
replaced direct environment variable querying

- Added dependency on appdirs from ActiveState which is mit licensed
- Query the cache directory through appdirs, which makes that bit
cross-platform: no more crash on windows because of this.