Add closed and open path ROIs
Allow editing of shape segments
Move code to separate file
Clean up code