Don't access dom for scripturl when it's not needed
Fixes class issue for introlist
Fixes test for introlist directive
Changes structure of the code, now build into one individually wrapped function instead of many single ones