Sort by length of string to prevent smaller texts to be replaced in larger strings
Better dupe check (though cant check your whole source unless that was pasted in)