Basic support for editing

Editing is now working, requires additional polish and testing