Fix gap buffer bug for extend_gap_at

When the gap start was the same as the new gap location, it did
not copy old contents correctly.
Fix offset corruption bug

When the size of the deleted text was bigger than the cached offset,
a negative offset would be cached after updating the mappings.
Use size_t instead of long for offset caching

No reason a signed type should be used, and size_t is more
appropriate for in-memory array offsets anyway.
Remove old cruft
Add proper setter of a view's last visible line
Pass an invalidate offset for buffer mod notifications

Since this might differ from the offset used to change the
content (since the gap might have been moved from before
the change offset).
Fix cursor move from an invalid position
View: Reset the entire display upon config changes
Add View.has_focus property
Slightly improve view resize handling

If the view is grown vertically we make sure to show the same last
visible line. This should be revisited in the future to better keep
track of any previous cursor location.
Add View text_dimensions method

For obtaining some basic height/width geometry information.
Adjust cursor position upon inserts/deletes

When applicable.
Invalidate display lines correctly upon mods

Where the gap buffer gap has changed before the modification
offset.