Cleanup modal edit
Move javascript to script file