Ideally, network related params should be part of config, which is
passed down to the components to avoid references to global instances.
This commit is only halfway through as there are a couple of structs
that are too small to house the params and are still referencing
global variables. We'll rework that later.