added js loading and moved php off index page.
removed require statements, index no longer contains any php.