Fix command_exists to work with builtin commands.

Was mistakenly using -P option to type, which requires that the 
command be in the path. Using -t will also check aliases, functions,
and builtins. However, due to the script starting a new shell, it 
will not find aliases and functions defined by the caller.