pep8 and pylint fixes, comments, use os.path.[expanduser, expandvars]