Implement union, intersect and diff. Add some tests.