Missing commands in OSX

In OSX readlink has different arguments and realpath doesn’t exists.
These commands where being used to determine the absolute physical path
of a file. It is not necessary to use these commands to do this. Instead
a abs_path function has been created that uses pwd, basename and
dirname.