Update main.htm

fixed javascript, allowed for adding and clearing
added prereq code for modals