Fix range errors on book change.

Yet another attempt at fixing cursor placing and range errors on book change.

This avoids placing the cursor in places where webkit does not like it, and it avoids the hidden metadata blocks. In fact, it avoids anything with data-type, thereby hopefully hitting the first heading or paragraph.