Cleanup of variables and test calls
Improved help with here doc
Substitute $HOME with ~