Added function for detecting if command exists.

The function is called commandExists and is located in global.sh in
bashrc.d
Mayor cleanup of the installscript.

-Broke functionallity into functions.
-Restructured the code.