Default to [0] for random port, assign env default

* If "env" is unassigned, opening the app modal throws an exception.
  Default to an empty object to start in an expected state.
* Sending port 0 means, "give me a random port." That was how the UI
  acted before form validation, and it should continue to do that for
  backwards compatibility.