improved script handling and loading between modules, load only on pages where needed