Remove trailing whitespace in config files
Add error-on-service-unavailable option, move configuration handling to its own class