Add unset_vars function
Add echo_and_die function
Change error exits to echo_and_dir function calls