set HOME variable instead of passing homedir to every function

Signed-off-by: Thanh Ha <thanh.ha@alumni.carleton.ca>
Change from pep8 to flake8

Signed-off-by: Thanh Ha <thanh.ha@alumni.carleton.ca>