Replaced "readlink -f" with shell code (due to Mac OS X)
Avoid crashing via __builtin_frame_address(3+) on Mac OS X
Only test once (no more dynamic AND static tests)

chg: also BS cleanup