Prefer outgoing address over loopback when using autodetect.

This makes autodetect more useful when the runtime and editor are on diferent systems.
Add a jslinter as this module does not have tests.