mod: remove ECMA-5 methods to make it more browser compatible
diff --git a/lib/difflib.js b/lib/difflib.js
index 4a46c61..89bef5c 100644
--- a/lib/difflib.js
+++ b/lib/difflib.js
@@ -529,10 +529,13 @@
           >>> s.realQuickRatio()
           1.0
       */
-      var matches;
-      matches = this.getMatchingBlocks().reduce((function(sum, match) {
-        return sum += match[2];
-      }), 0);
+      var match, matches, _i, _len, _ref;
+      matches = 0;
+      _ref = this.getMatchingBlocks();
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        match = _ref[_i];
+        matches += match[2];
+      }
       return _calculateRatio(matches, this.a.length + this.b.length);
     };
 
@@ -958,8 +961,8 @@
       common = min(_countLeading(aline, '\t'), _countLeading(bline, '\t'));
       common = min(common, _countLeading(atags.slice(0, common), ' '));
       common = min(common, _countLeading(btags.slice(0, common), ' '));
-      atags = atags.slice(common).trimRight();
-      btags = btags.slice(common).trimRight();
+      atags = atags.slice(common).replace(/\s+$/, '');
+      btags = btags.slice(common).replace(/\s+$/, '');
       lines.push('- ' + aline);
       if (atags.length) {
         lines.push("? " + (Array(common + 1).join('\t')) + atags + "\n");
diff --git a/src/difflib.coffee b/src/difflib.coffee
index c739267..fbaae52 100644
--- a/src/difflib.coffee
+++ b/src/difflib.coffee
@@ -622,9 +622,9 @@
     >>> s.realQuickRatio()
     1.0
     ###
-    matches = @getMatchingBlocks().reduce ((sum, match) ->
-      sum += match[2]
-    ), 0
+    matches = 0
+    for match in @getMatchingBlocks()
+      matches += match[2]
     _calculateRatio(matches, @a.length + @b.length)
 
   quickRatio: ->
@@ -1008,8 +1008,8 @@
                  _countLeading(bline, '\t'))
     common = min(common, _countLeading(atags[0...common], ' '))
     common = min(common, _countLeading(btags[0...common], ' '))
-    atags = atags[common..].trimRight()
-    btags = btags[common..].trimRight()
+    atags = atags[common..].replace(/\s+$/, '')
+    btags = btags[common..].replace(/\s+$/, '')
 
     lines.push('- ' + aline)
     if atags.length