Allow dirt scripts to be run inline with apps, refactor app running for
testability.