Remove usage of which and use command instead

Command is POSIX compliant with a defined exit status (unlike which).
Which was not installed on the system I was using, so relying on a
builtin really is much safer. Further commentary here:

http://stackoverflow.com/questions/592620/how-to-check-if-a-program-exists-from-a-bash-script

Also removed some unnecessary whitespace.