Place cursor only if no selection, extract code.

While the previous attempt at fixing #211 placed the cursor correctly
for normal mode, it did break reverse mouse selections by chopping off
one character at the end.

The code is extracted to a new class which now listens for mouse clicks.
If the selection is still empty after the user releases the mouse (i.e.
she didn't drag), it is assumed that a click was meant and thus the
caret is placed in the right position.

Work for #440.
Clean up place cursor code

There's no longer any need for async calls as the mouseUp event is
called at another time than the caretMoved event.

Work for #440.
Change caret type if caret is placed after line

Holding down the mouse after a line would show the caret in the wrong
position. Use the left-shifted caret so that this doesn't happen.

Work for #440.