Use event.which to determine keycodes.

It's safer since to rely on event.which since jQuery normalizes
event.keyCode and event.charCode.

Further information is available in the jQuery docs at
http://api.jquery.com/event.which/
Minor indentation fix.
Added the ability to open rows in new tabs.

If proper anchor tags were used, we would be removing the ability to
select text with the mouse, thus we emulate the anchor behaviour.
While this is far from perfect, covers both use-cases (selecting text
and opening links in new tabs) in most of the situations.

Fixes bug 2657.