Add ast comparator functions and tests