add osx setup stuff
fix a bunch of bugs in osx.sh