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.
can you add `rm` commands to `cleanup` for all these files? If the test dies partway through, the inline `rm` commands wouldn't catch them all.