Modify the brew script to use the builtin cd, pwd, unset, and exec

This allows brew to continue working in cases where the user has defined
a function named cd, pwd, unset, or exec