Previously there was really no logic with what is shown if the cursor
was on top of multiple elements at the same time.
Now the hovering logic always prefers the closest vertex that is picked
from near the mouse cursor and only if there are no nearby vertices,
will edges be selected. Picking also takes the current view zoom into
account properly which it didn't do before.
Also includes some code cleanup.
gitlab #44
Change-Id: Ie20ae4831effcd1d4a78f0cdf45fd3fbc2c14993