Take zoom levels into account when drawing the caret (issue #127)

Also fixes a similar issue where virtual selection overlays were being incorrectly drawn when zoomed in or out on firefox.