Remove duplicated download/streaming code in Run.

Logic to determine when something should be downloaded into memory or streamed
was duplicated. This is now in its own method.
Simplify Run#_set_all_ports.

There was some code duplication which made the whole thing look overly complex.