Tests for PROFILE detection

Baby steps towards a tested install script, take 2:

This PR tests how the PROFILE is detected and simplifies conditions is the install function.
`ksh` doesn't support `local`, and requires `typeset` - but `zsh` (i think) doesn't work with `typeset`, so in `ksh` you'll get a ton of `local` errors in stderr, altho everything will work fine.