Make things work on osx

o Portable find command
o minor other fixes
o array expansion working on bash 3