strip whitespace from keys (especially newlines)