Move equality testing from patch into own module
Semi-smart diffing