Fix layer selection and point translation for mouse events

Select the topmost layer at a given point to send mouse events and when
sending the event, ensure that they are relative to the layer origin,
rather than in absolute page coordinates.

Fixes #3504.
My name is indeed pretty ambigous. What this actually means is "point relative to layer origin." How do you feel about point_relative_to_layer_origin?