Switch from 'readlink -f' to more portable command.

This 'readlink -f' resolution is a GNU readlink behavior. Using Bash `cd` is
portable across OS X and other platforms.