Rect operations: comparisions, union, intersection

All core operations apart from line/point functions. A C wrapper for some things that were actually macros was required :\