scope rangy to the region's document/window so selections can be properly serialized/restored
save selection on html region blur, restore when needing to perform replacements.
Merge pull request #413 from brentkirby/topic/contenteditable

save/restore selection functionality. fixes for rangy issues on iframes.