chore(app): organize application script files better

This makes each one much tinier, and therefore easier to understand.

I hope this doesn't break anything...