Setting caret position (focus) to before a node

Before, it could only set to inside a node.

Now it can also set to node itself.

This fixes issue #509.

This has no tests, yet. Don't review.