Make mouse handling respect CSS scaling.

Also DRYs getPointer() calls in many places.

See #868.
Also consider CSS transforms when handling mouse.
Handle missing canvas bounds information correctly.

Fixes test failure.
Merge pull request #1168 from aspectit/css-scale-new

Fix mouse handling if the canvas has been scaled via CSS.