Two small performance improvements

Stop calling _.isFunction for every item on every draw loop; also optimize one heavily used for loop.