Converted Array.prototype.diff and cleaned up an order of operations issue