Make check_represented_in independent of intersect/reduce

This narrows the bug field a bit more. Having the check functions rely less on
the main path of ason_reduce makes the code easier to validate anyway.

Signed-off-by: Casey Dahlin <casey.dahlin@gmail.com>
Initialize max_order correctly in ason_reduce_object_intersect_join

Previously we were incapable of reporting a value less than 1.

Signed-off-by: Casey Dahlin <casey.dahlin@gmail.com>
Don't set object order after reducing to empty

Signed-off-by: Casey Dahlin <casey.dahlin@gmail.com>
Set object order correctly

An object containing an order 2 value is always order 3.

Signed-off-by: Casey Dahlin <casey.dahlin@gmail.com>
Set order in ason_reduce_list

The only reduction path that never set the order

Signed-off-by: Casey Dahlin <casey.dahlin@gmail.com>
Add order_test test suite

Signed-off-by: Casey Dahlin <casey.dahlin@gmail.com>
Fix off-by-one removing duplicates from union

Signed-off-by: Casey Dahlin <casey.dahlin@gmail.com>
Rewrite ason_reduce_intersect to use orders

We can reduce intersection much more cleanly now. And, indeed, the
recently-failing test cases now pass.

We've uncovered a category of defects in intersection that still remain (we
largely don't handle order 3 values correctly) but it's a more defined problem
now, and the cases it occurs in are more likely to be rare.

Signed-off-by: Casey Dahlin <casey.dahlin@gmail.com>