Xcode cleanup; add some support for running from the command line