Refactoring and improvements in add/edit page
More refactoring, commenting and cleanup: removed add.js