Cleaned up Mac stuff; put it in conditionals.
Made ls adjustments safer; now accounts for BSD.
Merge branch 'master' into mac