Fixes #231 and #153.

Makes sure this.range is defined when calling selection.getContaining and selection.placeMarkers. Makes sure the current selection is inside the scribe element before placing markers.