make menu.sh a function

and add a test.sh script to test the env_var set