Renamed pipeControlPoints to controlPoints. Use Util.linear instead of LinearFunction. Various other fixes to the code ported from java sim.