A `datacmp` function would be quite nice.  It's essentially the opposite to `mergedata`.  Maybe the `difference` function could be used if we get polymorphic functions in the core some day.

In Perl I'd usually solve this by transforming both sides to their canonical JSON representation: sorted hash keys, no newlines, and quotes around all strings.  But CFEngine's `storejson` function doesn't have that option.