[Olena-patches] 1040: Various clean-ups + add line2d.