Clean up edit.js

Doesn't change functionality at all.
Merge pull request #1205 from Daniel-Hug/edit.js-cleanup

Clean up edit.js