Fixes 'directory' script.sh having two PATHs

The new computed PATH variable was appended instead of replacing the
PATH in the original environment.
PATH for 'directory' goes in and out of dir

If the original PATH was '/usr/bin:/bin', we would previously use
'mydir/usr/bin:mydir/bin'. We now use
'mydir/usr/bin:mydir/bin:/usr/bin:/bin'.