made jhbuild more cross-platform

Replaced some direct os environment variable querying with their equivalent cross-platform solutions.

Added a dependency on appdirs to take care of finding the right caching folder, in a cross-platform way.

Removed some legacy code from the monkeypatch (might need more work).

As a bonus, in the files I worked in, I tried to improved pep8 compliance by cleaning up some simple whitespace issues.