Micro optimisations

I know you like micro optimisations.

strtr faster than str_replace (we don't need to revisit replacements that have already happened)

XORing two characters gives a character, we don't need to do the double ord()