network: refactor code, split code for nm setting that generated automatically
network: refactor code, rename interfaceToJSON() to keyValueToJSON()