libRange emulates the W3C DOM Range API on IE 8 and earlier.  It's based on TinyMCE's code for the same, but depends only on jQuery (lightly) and an AMD implementation.