Converts tabs into spaces
Refactors mousedown event handler on canvas.

jQuery handles all browser compatibility problems regarding events quite well
and presents the x and y coordinates of the mouse pointer in e.pageX and
e.pageY. The offset of the canvas can be retrieved using jQuery as
canvas.offset(). The mousedown event fires if the mouse button is pressed.
A click event fires if a mouse button is pressed and released on the same
element.
Adds threshold to hit detection.

This avoids clicking in the middle of nowhere selects a cell.
Uses createImageData instead of getImageData

This is -- at least in Firefox 17 -- much much faster.