Add utility method safeAddModelOffset.

This helper function tests if an offset change will put us in the
middle of a newline sequence by checking the line information of the
next or previous lines. It can also check that the returned position
isn't past the last character.
Selection marks now support exclusive selection.