set full path to lib.php to allow cohorts pages to load without error when running under apache
remove scheme from remote js url so to use https if necessary