Tamyres' and Sarah's refactoring of EzimNetwork

1) Extracted 3 methods to make it clear what the code is doing:

applyLocalAddressSetting()
applyNiSetting()
confineSelectableNi()

2) Put all "if" statements inside one single loop, instead of executing
the same loop multiple times only to evaluate different "if" statements.