Removing dependency on which and substituting in the bash builtin 'type'. Moving the tput command finder inside of the function so there are no variables or statements polluting global namespace.