Config: Implement dumping the config in text form

Fixes #2754