Added new features for node handling for polylines
Finished adapting the implementation for polygons to polylines.
Next: debugging