Added editing functionality, fixed bug where new lines would break JSON.