rewrote javascript files

Located in js2 - my javascript is reorganized for (hopefully) clarity
fixed main & fun so they are functional

need to fix parseXML function in fun.js