WIP: Refactor config handling heavily [ci skip]

Change-Id: b73ca17722