Finish porting String#scrub for speed and compat.
fix minor indentation issues
shellcheck run: add quotes where they are warranted to fix potential unwanted expansions
Use $(..) instead of deprecated `..`
Use return instead of break in special opt processing function
minor indentation issue
make sure exit  always gets called if exec is called
Move the whole script into a main function
move platform identification into a function
Extract more functions from main
extract more functions and fix --profile.out handling bug