Improve name lookup performance.

Increase the speed in both name lookup functions by matching the
first character before peforming a function call.