memoize keyOf

This change produces a massive performance improvement.  Essentially keyOf is an extremely expensive function that's called a lot of times on most nodes so by memoizing it we gain a big performance boost.

This is demonstrated in a jsperf [here](http://jsperf.com/lexical-scope-memoization).