New configuration framework

New configuration framework, which simplifies code a lot. Should be fully compatible with the old one.
No, no, no, if there are so many config options put them in their own class