Code review fixes for "dx build --remote --run".

* Refactor to extract method _build_app (which does the build and
  returns the executable ID) from the rest of main.
* Add a regression test for dx build --dry-run MYAPP.
* Prohibit --dry-run and --run together, and add a regression test.
* Add a regression test for dx build --remote --app.
* Add a test for dx build --remote --app --run (which is not yet
  supported).