Clean up text lines

Trim spaces, fix case, sort and remove duplicate lines.