Update wrapper scripts and install

Fix a few issues with the wrapper scripts and add an install
routine.  The wrapper script should now exit automatically
when spawing shell exits.