Remove buildFlat from toplevel. Clean up unsafeSetRegion. Implement unsafeDeleteRegion.