Change the extent function in the Rec

Allow negative value.
Add Rect union function
Finish the union function
Add Rect Width and Height function
Rewrite the mossaic code