Implement $basedir and set default value to /home/$instance

Create a new variable $basedir to hold the base directory for the
instance.
Set new $basedir variable to /home/$instance
Perform a search and replace of /opt/$instance and replace with
to use new $basedir variable.
Create default symlink for GT.M to version found in $basedir/lib/gtm
Reformat some lines to be more readable