modularized the javascript results getting process. singlepage now accumulates results.