Change lines-array to be an object containing the lines, with hashes as keys (like the icons). Undo-function now works completely for lines, TODO: Add redo and fix undo for icons.