Added code for "edit" workflow. Jslint fixes.