Config.py: changing vars to getattr, and adding docstrings and comments

We were using vars(object) in inconsistent ways, so I have simplified functions that were using vars by using getattr instead.

I've also added several comments and docstrings to clarify various methods.