code: function(value) {
  		var ret = [];
  		var linesAndNewlines = value.split(/(\n|\r\n)/);
  		// Ignore the final empty token that occurs if the string ends with a new line
  		if (!linesAndNewlines[linesAndNewlines.length - 1]) {
  			linesAndNewlines.pop();
  		}
  		// Merge the content and line separators into single tokens
  		for (var i = 0; i < linesAndNewlines.length; i++) {
  			var line = linesAndNewlines[i];
  			if (i % 2) {
  				ret[ret.length - 1] += line;
  			} else {
  				ret.push(line);
  			}
  		}
  		return ret;
  	}
docs: Essentially lifted from jsDiff@1.4.0's PatchDiff.tokenize