fixed analyze tests. moved analyze and demo page javaScript out of main.js