range-context - refactors range preservation

Offset based range preservation is complicated and
error prone. Instead use node/atEnd representation.

Also moved preservation code from dom2.js to
range-context.js because it is too specialized.