fix Math.log + e.keyCode for blink and un-C-ify.

Because in JS, `/` is not integer division.