config.go: refactor to simplify structure and fix support for array elements
config.go: refactor to simplify structure and fix support for array elements

The refactor splits the handling of structs into a separate function and adds
a possibly empty fieldDesc parameter to applyEnvOverrides to allow applyEnvOverrides
to handle simple values as well as structs.

Signed-off-by: Jon Seymour <44f878afe53efc66b76772bd845eb65944ed8232@wildducktheories.com>

adityacs/kapacitor,sputnik13/kapacitor,influxdata/kapacitor,influxdb/kapacitor,alerta/kapacitor,influxdb/kapacitor,titilambert/kapacitor,adityacs/kapacitor,sputnik13/kapacitor,bbczeuz/kapacitor,muxinc/kapacitor,influxdb/kapacitor,alerta/kapacitor,muxinc/kapacitor,titilambert/kapacitor,yosiat/kapacitor,yosiat/kapacitor,bbczeuz/kapacitor,titilambert/kapacitor,adityacs/kapacitor,bbczeuz/kapacitor,sputnik13/kapacitor,alerta/kapacitor,yosiat/kapacitor,influxdata/kapacitor,muxinc/kapacitor,influxdata/kapacitor