var clipboard = {};

clipboard.copy = (function() {
  var interceptCopy = false;
  var copyObject; // Map from data type (e.g. "text/html") to value.

  document.addEventListener("copy", function(e){
    if (interceptCopy) {
      for (key in copyObject) {
        e.clipboardData.setData(key, copyObject[key]);
      }
      e.preventDefault();
    }
  });

  return function(data) {
    interceptCopy = true;
    copyObject = (typeof data === "string" ? {"text/plain": data} : data);
    document.execCommand("copy");
    interceptCopy = false;
  };
}());

clipboard.paste = (function() {
  var interceptPaste = false;
  var _resolve;
  var _dataType;

  document.addEventListener("paste", function(e) {
    if (interceptPaste) {
      interceptPaste = false;
      e.preventDefault();
      _resolve(e.clipboardData.getData(_dataType));
    }
  });

  return function(dataType) {
    return new Promise(function(resolve, reject) {
      interceptPaste = true; // Race condition?
      _resolve = resolve;
      _dataType = dataType || "text/plain";
      document.execCommand("paste");
    });
  };
}());

@@ -43,32 +43,33 @@
 ction() %7B%0A  var 
+_
 interceptCopy = 
@@ -53,36 +53,32 @@
   var _intercept
-Copy
  = false;%0A  var 
@@ -77,26 +77,21 @@
 ;%0A  var 
-copyObject
+_data
 ; // Map
@@ -185,32 +185,33 @@
 ion(e)%7B%0A    if (
+_
 interceptCopy) %7B
@@ -203,20 +203,16 @@
 ntercept
-Copy
 ) %7B%0A    
@@ -225,26 +225,21 @@
 (key in 
-copyObject
+_data
 ) %7B%0A    
@@ -271,26 +271,21 @@
 ta(key, 
-copyObject
+_data
 %5Bkey%5D);%0A
@@ -357,24 +357,25 @@
 data) %7B%0A    
+_
 interceptCop
@@ -371,20 +371,16 @@
 ntercept
-Copy
  = true;
@@ -388,18 +388,13 @@
     
-copyObject
+_data
  = (
@@ -484,24 +484,25 @@
 copy%22);%0A    
+_
 interceptCop
@@ -502,12 +502,8 @@
 cept
-Copy
  = f
@@ -558,16 +558,17 @@
 %7B%0A  var 
+_
 intercep
@@ -560,37 +560,32 @@
   var _intercept
-Paste
  = false;%0A  var 
@@ -671,16 +671,17 @@
     if (
+_
 intercep
@@ -681,21 +681,16 @@
 ntercept
-Paste
 ) %7B%0A    
@@ -683,32 +683,33 @@
 ercept) %7B%0A      
+_
 interceptPaste =
@@ -701,21 +701,16 @@
 ntercept
-Paste
  = false
@@ -889,16 +889,17 @@
 %7B%0A      
+_
 intercep
@@ -903,13 +903,8 @@
 cept
-Paste
  = t

Change all private variables to use underscores.