avoid unnecessary toLowerCase call

This patch reduces the number of calls to toLowerCase() method, as they can be quite expensive. Aliases and exclude list are stored in lower case, additionally toLowerCase is moved out of the loop.