Some minor kew optimizations

Hello everyone, 

Please review the following commits I made in branch 'jeremy-faster'.

bab963a1accc087128e6ed44b63ed43dcfd84ccd (2013-07-10 17:21:27 -0700)
Faster promise

R=everyone