Use configured bind address for HTTPFetch

Fixes #1471.

I also reduced the indentation of the surrounding code by about 3 levels by reversing conditionals, flattening if-elses and moving functions out of their definition; and cleaned up some related things.