Remove duplicate lines, sort, and trim whitespace.
Clean up lists by removing repeated entries and normalizing whitespace.