Sketch editor crud API

This introduces three new functions that should have the correct behavior:

    onInsertLine
    onRemoveLine
    onUpdateLine

There is lots of repeated code, but the logic should be correct. Feel free to scrap the code.