Improved on arrows and curve undo/redo.

Also added Arrow class, added CurveModifyHistoryItem, optimized code
overall, and fixed several pieces of code as well as comments.

There are still some history glitches to fix, especially regarding
Arrows.