readlink -f is not the same on OS X. Use custom implementation.
Fix for Darwin
Merge pull request #1 from tonylazarew/mac-specific

Few fixes for Darwin: workaround over different readlink -f and sed -i behaviors