Add builder API for Curve
and GlobalCurve
#904
+113
−36
Merged