trim whitespace from key and value while reading settings file

Stops ugly buildup in settings.cfg and correctly reads from it.