Mac OSX compatibility (readlink -f issue)

Implemented shim based on whether readlink -f throws an illegal operation error as recommended by http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac

Feel free to tidy up the implementation, but have tested from install on both Mac OSX 10.8 (mountain lion) and Ubuntu 12.04 (precise) and both install.sh and test.sh scripts are working correctly.