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.