cross browser fixes and ability to use rangy selection object instead of window selection object.