DOM Selection save and restore module, originally from "rangy"