New configuration framework

New configuration framework, which simplifies code a lot. Should be fully compatible with the old one.
It needlessly inflates the diff and prevents me (or anyone processing PRs, for the matter) from actually seeing what's the change and what's just a field name change.